October 5, 1995 cs470 - Computer Architecture 1 =============================== Fall 1995 (14 weeks) Project - due November 27 ========================= Introduction ------------ The purpose of the project is to let you do some individual work on a topic that is relevant for the Computer Architecture class. This work will involve using the knowledge gained in class, through your readings and through the process of trial and error involved in everything people design. Topic ----- Design (and prove it's useable) the Instruction Set for an architecture defined as follows. Please be aware that the description I provide is incomplete, and that you are supposed to fill in the missing parts. * 4-bit datapath (don't laugh!) * access up to 4096 4-bit 'words' of memory; little Endian model * 8 4-bit general purpose registers * multiple of four instruction length * no interrupts (this gets things to be easier) Hints ----- Given the small amount of memory available I would go for an architecture style that offers a very compact encoding of instructions; you can try an accumulator like machine but a stack one is not out of discussion (in which case you'd eliminate the 8 registers). A 4 bit opcode for instructions seems to be the natural choice: but in this case you must very carefully choose what you want to include in the instruction set and what you leave aside. Remember that you must prove your design can be used. Also due to the small amount of memory, you must be very careful in choosing the addressing modes: going with only one, say 'memory direct' might make instructions pretty large (this consumes memory and lengthens the fetch time), while choosing several has implications on the instruction encoding (you have to indicate what mode to use). With such a simple CPU you don't expect to build big: a typical system would probably have some of the memory space dedicated to a ROM and what's left to a RAM. At power-up or at reset the CPU starts reading instructions from address 0. Low addresses could then go in the ROM; in this memory area could be your whole application or just a simple loader that reads your application from I/O (read into the RAM) and, after that, transfers control to the loaded program. The hardware can't be too involved as mentioned and neither the software can. I would suggest that the I/O is memory mapped; this saves opcodes (at the very least). What to turn in --------------- Two things: A) A paper that describes: * instruction formats * a list of instructions with: - the format for that particular instruction (with the binary opcode in clear) - what the instruction does (including side effects if any) * a description of major decisions you had to make in your design The format of the paper is described in appendix A. B) A program written using your instruction set: each student or group of students will be notified about the specific application to implement. In any case these programs will involve doing I/O and handling data objects larger than 4 bits. Students may choose anything to implement as long as thay have thair instructor's approval. All programs will be written assuming as assembler is available: see appendix B for more details Note: in real life opcodes are chosen in such a way as to ease the hardware implementation; in you project you will chose opcodes at your will, just keep in mind that chosing them properly would be an extra task to perform in real life. Policies -------- Students are encouraged to work in groups no larger than 2: cooperation is the key and, hopefully, after you finish this project, you'll be much better at sharing responsabilities and rewards. Students must defend their projects individually even if they work in groups. Team members are supposed to have a good knowledge of the whole project, and a very good knowledge of what they've been in charge for. Students may choose their teammates no later than October 9, 1995. After this the instructor will assign the teams. Recommendations --------------- * Start early, this is not a project to be finished the night before it's due. * Keep your instructor informed about your progress. Appendix A: The format of the paper you turn in ================================================ Your paper will be typed or computer printed, double spaced, using Times Roman 12 for the text. For programs use Courier 12, single spaced. The front page will contain (in this order) - class number and name - instructor's name - student's name - student's e-mail address - the footer will indicate the department (Computer Science and Applied Mathematics) and the institution (Illinois Institute of Technology). The rest of your paper must include: - Introduction: you briefly describe what you've done - Implementation: you describe in detail what you have done - Discussion: here goes a discussion of the major problems you have faced and how you solved them - Acknowledgements: give credit to anyone that has haelped you in any way - References: name the articles/books/etc. you have used in doing your work; use the format the textbook uses. - Appendices: most of the raw stuff (programs, etc.) The footer of each page will include the class number, the term and the institution name, something like: cs470 - Fall 1995 Illinois Institute of Technology with a small font (10 is ok). Appendix B: Assembler conventions ================================= As you write assembly language programs, it is important to keep your code and data separate; you probably don't want to execute your data, neither want you to modify your instructions (don't even think about it). Most assembler provide 'assembler segments' as a way to help you maintain the distinction between data and code: each segment holds a distinct set of objects. * text segment: holds the instructions * data segment: holds data Here is a list of directives the assembler should understand Directive Meaning ------------------------------------------------ .data start data .text start text (instructions) .4bit initialize a 4-bit data .byte initialize a byte .half-word initialize a 16-bit data .word initialize a 32-bit data .ascii initialize with a string of chars .reserve reserve a block of uninitialized memory ------------------------------------------------ Some examples: .data 0x100 # start this at the address 0x100 a: .4bit 3 # a is a 4-bit data with the initial value 3 b: .word 666 # b is 32-bit wide with initial value 666 c: .ascii "cs470" # c is the null terminated string "cs470" d: .reserve 8 # reserve 4 bytes (8 4-bit) for d .text 0x200 # start code at 0x200 (the value is optional) .......... # your code