CSIT 301 (Blum)1 Instructions at the Lowest Level Some of this material can be found in Chapter 3 of...

download CSIT 301 (Blum)1 Instructions at the Lowest Level Some of this material can be found in Chapter 3 of Computer Architecture (Carter)

If you can't read please download the document

description

CSIT 301 (Blum)3 Data Movement Many of the micro-code steps involve moving data and addresses to various locations (registers, memory locations, etc.) The information is often, but not always, sent over the bus. So information must be put on and taken from the bus.

Transcript of CSIT 301 (Blum)1 Instructions at the Lowest Level Some of this material can be found in Chapter 3 of...

CSIT 301 (Blum)1 Instructions at the Lowest Level Some of this material can be found in Chapter 3 of Computer Architecture (Carter) CSIT 301 (Blum)2 Input port 1Accumulator ALU Flags Input port 2 Prog. counter Mem.Add.Reg. Memory MDR Instr. Reg. Control C B TMP Output port 3 Output port 4 Display Keyboard encoder Bus CSIT 301 (Blum)3 Data Movement Many of the micro-code steps involve moving data and addresses to various locations (registers, memory locations, etc.) The information is often, but not always, sent over the bus. So information must be put on and taken from the bus. CSIT 301 (Blum)4 Controlling a register One enters a value into a register (i.e. loads it) If the load control input is active When the clock is at the appropriate part of its cycle (e.g. positive edge) If a register is allowed to place its value on the bus, it will have an enable control input. It will do so When the enable control input is active CSIT 301 (Blum)5 The clock pin The clock is another control pin (sometimes called a timing pin) which determines when a register takes the value on the bus. The load input determines if the register takes the value. The clock input determines when the register takes the value. CSIT 301 (Blum)6 The clock A binary clock: Each cycle (01) should take the same amount of time (the time for a cycle: the period) The number of cycles in a second is called the frequency. On the edge: many registers load on the clocks edge Positive edge: as 0 goes to 1 Negative edge: as 1 goes to 0 CSIT 301 (Blum)7 Other control pins Items involved in data manipulation (as opposed to simply data movement) will require additional control pins. For example, the program counter needs to be incremented. Thus additional control pins are required These pins are sometimes also referred to as enable pins, as they enable a particular action CSIT 301 (Blum)8 ALU control The primary data manipulator is the ALU. The control pins here select between various logic and arithmetic operations Add, Subtract, Multiply, AND, OR, etc. CSIT 301 (Blum)9 Micro-code is Micro-code is 1s and 0s stored in ROM The ROM output is connected to control pins. For example, one micro-code instruction is to take the value from the program counter to the memory address register So send active signals to enable the PC and load the MAR CSIT 301 (Blum)10 Micro-coding Load Accumulator A To discuss coding from the bottom up, one starts with micro-code. Micro-code is burned into the read-only memory (ROM) of the control unit and is sent out to the control inputs of the other components. Let us examine the micro-code of the assemble level instruction Load Acc. A Assume control inputs are active when they are high CSIT 301 (Blum)11 Input port 1Accumulator ALU Flags Input port 2 Prog. counter Mem.Add.Reg. Memory MDR Instr. Reg. Control C B TMP Output port 3 Output port 4 Display Keyboard encoder Bus (Architecture reminder) CSIT 301 (Blum)12 Address State: the value of the program counter (which recall is the address of line of the program to be performed) is put into memory address register. Control pins Assume here that 1 is active and 0 is inactive active high CSIT 301 (Blum)13 Increment State: the program counter is incremented, getting it ready for the next time. CSIT 301 (Blum)14 Memory State: the current line of the program is put into instruction register (so Control knows what to do). CSIT 301 (Blum)15 Recall the instruction consisted of a load command and an address. A copy of the address is now taken over to the memory address register. CSIT 301 (Blum)16 The value at that address is loaded into Accumulator A. CSIT 301 (Blum)17 For the load command, there is no activity during the sixth step. It is known as a "no operation" step (a "no op" or "nop"). CSIT 301 (Blum)18 These 1s and 0s are MICRO-CODE. (Dont confuse micro-code with macro-code.) It is fed directly to the hardware (specifically the control pins of the devices). Unless you are a hardware manufacturer, you usually dont program at this level known as microprogramming. You might copy someone elses code when you flash the BIOS. CSIT 301 (Blum)19 The von Neumann bottleneck" Our basic approach is to get the instruction from memory (fetch) Get the data from memory or put data in memory, etc. (execute) We go back and forth between the memory and CPU, one instruction at a time. This is sometimes called the von Neumann bottleneck. Ideas like caching and pipelining attempt to speed the process up but they dont vary from the overall approach. CSIT 301 (Blum)20 Lots of registers After Memory, Control and the ALU, most of the other items in this architecture are registers. A counter is a register that can increment Registers are small units of memory that are associated with the processor. The registers serve various special purposes. In some cases, main memory could be used in place of a particular register, but using the register speeds up the processor. CSIT 301 (Blum)21 Speeding up the process Registers are faster than main memory because writing to or reading from a block of memory is (at least) a two-step process Specify the address Read or write a value at that address A register is a single unit of memory and thus eliminates the first step. (There is also a vicinity consideration, the registers are on the processor chip, the memory is on a separate chip or chips.) CSIT 301 (Blum)22 Register size The size of the registers (the number of bits, binary digits, it has) is an important feature of a processor. A register may hold Data: thus its size may affect the range and/or precision of numbers available. Address: thus its size may affect the number of addressable locations. Instruction: thus its size may affect the number of instructions one can have. CSIT 301 (Blum)23 Intel family chip comparison table from howstuffworks.com Its been at 32 bits for awhile so one doesnt hear a lot about it, but 64 is already here for high-end processors. CSIT 301 (Blum)24 Register hiding Registers play a role in programming at the assembly level, but their use is hidden when one programs with high-level languages. (The programming language C allows for some low-level programming.) This is an example of those familiar ideas Layering Information hiding CSIT 301 (Blum)25 References Computer Architecture, Nicholas Carter Computer Organization and Design, David A. Patterson and John L. Hennessey Digital Computer Electronics, Albert P. Malvino and Jerald A. Brown