1 / 25

Instructions at the Lowest Level

Instructions at the Lowest Level. Some of this material can be found in Chapter 3 of Computer Architecture (Carter). Bus. Keyboard encoder. Input port 1. Accumulator. Flags. ALU. Input port 2. Prog. counter. TMP. Mem.Add.Reg. B. Memory. C. MDR. Output port 3. Display. Instr. Reg.

janettes
Download Presentation

Instructions at the Lowest Level

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. Bus Keyboard encoder Input port 1 Accumulator Flags ALU Input port 2 Prog. counter TMP Mem.Add.Reg. B Memory C MDR Output port 3 Display Instr. Reg. Output port 4 Control

  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.

  4. Controlling a register • One enters a value into a register (i.e. loadsit) • 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

  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.

  6. The clock • A binary clock: 10101010101010101010 • 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 clock’s edge • Positive edge: as 0 goes to 1 • Negative edge: as 1 goes to 0

  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

  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.

  9. Micro-code is • Micro-code is 1’s and 0’s 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”

  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

  11. Bus (Architecture reminder) Keyboard encoder Input port 1 Accumulator Flags ALU Input port 2 Prog. counter TMP Mem.Add.Reg. B Memory C MDR Output port 3 Display Instr. Reg. Output port 4 Control

  12. Control pins  Assume here that 1 is active and 0 is inactive – “active high” 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.

  13. Increment State: the program counter is incremented, getting it ready for the next time.

  14. Memory State: the current line of the program is put into instruction register (so Control knows what to do).

  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.

  16. The value at that address is loaded into Accumulator A.

  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").

  18. These 1’s and 0’s are MICRO-CODE. • (Don’t 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 don’t program at this level known as microprogramming. • You might copy someone else’s code when you flash the BIOS.

  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 don’t vary from the overall approach.

  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.

  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.)

  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.

  23. Intel family chip comparison table from howstuffworks.com It’s been at 32 bits for awhile so one doesn’t hear a lot about it, but 64 is already here for high-end processors.

  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

  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 • http://en.wikipedia.org/wiki/Addressing_mode

More Related