Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
An Example Architecture A Paper Computer - Woody Woody's characteristics Word size – 8 bits One word A Paper Computer - Woody Woody's characteristics Main Memory Word size – 8 bits Memory size – 32 words ... A Paper Computer - Woody Woody's characteristics Main Memory Word size – 8 bits Memory size – 32 words Memory addresses are 0 through 31 How many bits does it take to represent an address? ... A Paper Computer - Woody Woody's characteristics Main Memory Word size – 8 bits Memory size – 32 words Memory addresses are 0 through 31. 3110 = 111112 ... A Paper Computer - Woody Woody's characteristics Word size – 8 bits Memory size – 32 words Memory addresses are 0 through 31. 3110 = 111112 Addresses can be represented with 5 bits Main Memory 00000 00001 00010 00011 00100 00101 00110 00111 01000 01001 ... 11110 11111 A Paper Computer - Woody Woody's characteristics Word size – 8 bits Memory size – 32 words Memory addresses are 0 through 31. 3110 = 111112 Addresses can be represented with 5 bits Woody uses signed magnitude representation for storing integers (no floating point) Main Memory 00000 00001 00010 00011 00100 00101 00110 00111 01000 01001 ... 11110 11111 Woody's CPU Central Processing Unit Instruction Register Program Counter Register Data Register Instruction register – holds currently executing instruction from program Program Counter Register – hold address of next instruction to execute Data Register – holds the data used in the execution of an instruction Other Components Input unit – device that allows the user to enter values – e.g. keyboard Output unit – device that allows Woody to display a value (e.g. screen) Woody's Assembly Language Instruction Argument Meaning CopyFrom Location Copy from Location to the Data Register CopyTo Location Copy from Data Register to Location Add Location Add the number at Location to the DR Subtract Location Subtract the number at Location from the DR Read Copy from the Input Unit to the Data Register Print Copy from the Data Register to the Output Unit IfNegGoTo Stop Location If the DR holds a negative value, go to Location Stop execution of the program Machine Language Instructions must be in binary form to execute Woody can't store "CopyFrom" nor understand what to do with it It is easiest if all instructions are the same size and fit into a single word How big can our instructions be? Woody's Machine Language Assembly Language Instruction Machine Language Instruction CopyFrom 000 CopyTo 001 Add 010 Subtract 011 Read 100 Print 101 IfNegGoTo 110 Stop 111