1 / 18

Introduction to Registers

Introduction to Registers. Being just logic, ALUs require all the inputs to be present at once. They have no memory. A. B. S. F. ALU. Basic Computation.

sine
Download Presentation

Introduction to Registers

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. Introduction to Registers • Being just logic, ALUs require all the inputs to be present at once. • They have no memory. A B S F ALU

  2. Basic Computation • Computers perform complicated tasks only because the programmer has broken that task down into a sequence of simple primitive operations. • Moving information • Performing simple arithmetic and logical operations • To perform operations in sequence, the results of previous operations must be remembered somehow.

  3. Using Memory • Even the simplest computations require memory. • For example, take a pocket calculator. To add 4 and 3: • Press ‘4’ – calculator remembers the number • Press ‘+’ – calculator remembers ‘4’ and ‘add’ • Press ‘3’ – calculator remembers ‘4’, ‘add’ and ‘3’ • Press ‘=’ – calculator works out the answer and remembers it so it can be displayed • To achieve this kind of functionality, we need a circuit that can remember binary numbers – a register.

  4. Memory Circuits • Simple memory circuit can be built using a pair of NOR gates: • If the SET input is high, the output goes high • If the RESET input is high, the output goes low • If neither input is high, the output stays in its previous state

  5. 0 1 (0) (1) (0) 0 0 1 1 0 (0) (1) (1) (0) (0) (1) 1 0 How it Works NB. Output of NOR gate = 1 only if both inputs are 0 0 0 (1) (0) (1) 0

  6. Flip-Flops • The R-S flip-flop is an asynchronous flip-flop. Its output changes immediately in response to an input. • Synchronous flip-flops only respond when they are ‘clocked’ by a separate clock-in. • Synchronous devices are preferred in computer design to avoid problems with unpredictable propagation delays. • Simplest synchronous flip-flop is probably the D-type flip-flop. • It is also the basis of a single-bit memory register.

  7. D CLK Q The Flip-Flop. A Single Bit Register. CLK Q Q D

  8. D0 D1 CLK Q0 Q1 A Two-bit Register CLK Q Q Q0 CLK D0 D Q Q Q1 CLK D1 D

  9. CLK CLK D D Q Q 7 7 CLK CLK D D Q Q 6 6 CLK D D Q Q 5 5 CLK CLK 8 8 D D Q Q 4 4 D0-7 D0-7 Q0-7 Q0-7 CLK D D Q Q 3 3 CLK D D Q Q 2 2 CLK (shorthand form) D D Q Q 1 1 CLK D D Q Q 0 0 Multiple Bit Register • To remember a whole byte, just use eight flip-flops…

  10. The ‘Working Register’ • The most common use of a register in a micro-controller is in conjunction with an ALU. • To simplify the inputs, one of the operands of any ALU operation is stored in a register. • Depending on the device, this register is known as: • The Working Register (W) • The Accumulator (A)

  11. Using a Working Register

  12. Single input byte 8 Working CLK register D Q A B Control S ALU inputs C F OUT 8 Carry Result output Example Operation • To subtract 3 from 5… • Stage 1 • Store the number 3 in the working register • Ignore the ALU output • Stage 2 • Input the number 5 and the selection word, S, representing (A – B) • ALU output equals 2

  13. Are registers the same as memory ? • Yes • Computer memory (RAM) is, effectively, a big bank of registers. • In the PIC microcontrollers, the registers are the memory. • No • Memory is usually physically separate from the microprocessor. • Most microprocessors have only a few registers. • Registers can be read from and written to very quickly. • Register contents can be exchanged directly.

  14. CLK1 CLK 8 8 D0-7 Q0-7 Q0-7 CLK2 CLK 8 8 D0-7 Q0-7 Q0-7 Interconnecting Registers • How do we transfer information between two registers ? Like this ?

  15. Three Registers • OK, that sort of works, what about 3 registers ? Don’t try to make sense of this. It’s an utter mess ! CLK 8 8 D0-7 Q0-7 CLK CLK 8 8 8 8 D0-7 Q0-7 D0-7 Q0-7

  16. Three Registers Mk II CLK1 CLK 8 8 D0-7 Q0-7 CLK2 CLK 8 8 8 D0-7 Q0-7 CLK3 CLK 8 8 D0-7 Q0-7

  17. Interconnecting Registers • All registers are connected to a common set of 8 wires – a bus. • Each register needs a ‘switch’ to determine whether the bus is connected to: • The register output • Register is outputting to the bus • The register input • Register is inputting from the bus or… • … register is ignoring the bus • Using this basic scheme, any number of registers can be connected to the bus with no increase in complexity.

  18. Summary – ALUs and Registers • ALUs, despite their complexity, they are just combinational logic circuits with no memory. • Registers are fast access memory elements found inside microprocessors, micro-controllers etc. • Registers and their interconnections will be be discussed in more detail next time.

More Related