1 / 13

Microprograms

Microprograms. L17 Guilin Wang School of Computer Science The University of Birmingham [adapted from Ata Kaban]. This Lecture. • Control Logic • Microinstruction (execution) • Mapping clock phases to control signals • Implementing a multiplication algorithm. Clocks and Control logic.

niran
Download Presentation

Microprograms

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. Microprograms L17 Guilin Wang School of Computer Science The University of Birmingham [adapted from Ata Kaban]

  2. This Lecture • Control Logic • Microinstruction (execution) • Mapping clock phases to control signals • Implementing a multiplication algorithm

  3. Clocks and Control logic • Computer: various components connected via BUS - So, need to control the transfer to the Bus… • This is done by Control Logic. • Control Logic uses clock

  4. Microprogrammed Computers • We now know enough about how to organize an entire computer from various components. • An example is given in Figure 4.15 (Book 1, Page 155). • This computer can execute microprograms, which are expressed in microinstructions, some extremely simple instructions. • Each word contains 16 bits.

  5. Example: Microprogram Memory • Place a microinstruction address in MPC • The contents available in MIR • This effect happens in Phase 5 only

  6. Microinstructions • Data is kept in main memory. • Microinstructions are placed in micromemory. • Example: The following 22 bits in micromemory are used in adder (next slide).

  7. Adder • Input via buses 1 and 2. • Output via bus 3. • Example: - If signals 1, 6, and 14 turned on, then A+MDR  MAR. - If signal 9 is on as well, then ...

  8. Clock Phase & Control Signals During each phase only certain control signals are allowed to turn on, specified in the table: Clock Phase Control signals which can be turned on 1 1-8 2 9-14 3 15-16 4 17-22 5 The control signals marked ''Phase 5''

  9. Multiplication Microprogram • Multiply • contents of register C by contents of A • place result in main memory cell I • The algorithm set MDR to 0 repeat A times add C to MDR move 1 to MAR and set control signal to write

  10. Sketch of a Microprogram for Multiplication Micro Mem. add. Microinstruction Explanation 0: 0+0 MDR; MPC+1MPC Initialize MDR (13, || 17, 22) 1: MPC+TESTZEROMPC Check if A is 0 (19, 22) 2: 5  MPC Yes: exist from loop (8, ||10, ||18) 3: C+MDRMDR; MPC+1 MPC No: add C to MDR (3, 6, || 13, || 17, 22) 4: A-1A; 0+1MPC Decrease A and go to top of loop (1, 5, 7, || 9, || 17) 5: 0+1MAR; write; MPC+1 MPC Write product into cell 1 (5, || 14, ||16, || 17, 22)

  11. Sketch of a Microprogram for Multiplication Exercise: Given A=2 and C=4, follow the execution of the above microprogram

  12. Analysis of the Algorithm • Notice the loop executes A times (worst case: the register for A is n bits, then 2n – 1 execution) • Is there any faster way? Yes, use shift left. (For the Algorithm see Page 158 of the book)

  13. Summary • Control Logic • How to execute Microinstruction in Microprograms • Implementing & analysing multiplication as a Microprogram

More Related