Lecture 9 Design of the Computer Instruction Set and the CPU Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU
Design of the Computer Instructions
Registers/ Addresses Numbers AL000 AH001 BL010 BH011 CL100 CH101 DL110 DH111 MOVEAL, AH ADDBL, CL INCAH JMP , , , XXX 111XXX, XXX 1.Two address instructions 2.Each address requires three bits 3.Instructions require three bits Total = = 9 bit ≈ 2 byte Find the optimum one
Example 1 Let you are designing two address instructions for a microprocessor. You have 20 different instructions and your addressable memory is 128 bytes. What will the minimum length of your instructions? ItemBits 20 different Instructions5 128 different memories (1 st )7 128 different memories (2 nd )7 Total19 No of bytes are: 3
Example 2 Let you are designing three address instructions for a microprocessor. You have 64 different instructions and your addressable memory is 1MB. What will the minimum length of your instructions? ItemBits 64 different Instructions6 1 MB (1 st, 2 nd, 3 rd )20 x 3 = 60 Total66 No of bytes are: 9
Design of the CPU CPU / Microprocessor contains three elements – Registers – The ALU – The Control Unit
Register Design General purpose register stores address/data A computer can also execute instructions to perform shift operations We will design a shifter
Shifter Design
y3y3 y2y2 y1y1 y0y0 __ OE S1S0S1S0 4-input MUX i 3 i 2 i 1 i 0 i -1 i -2 i -3
y3y3 y2y2 y1y1 y0y0 __ OE S1S0S1S0 4-input MUX i 3 i 2 i 1 i 0 i -1 i -2 i -3 Alternative Design
Design Left Rotator Using Left Shifter
y 15 y 14 y 13 y 12 y 11 y 10 y 9 y 8 y 7 y 6 y 5 y 4 y 3 y 2 y 1 y 0 __ OE S1S0S1S0 X 15 X 14 X 13 X 12 X 11 X 10 X 9 X 8 X 7 X 6 X 5 X 4 X 3 X 2 X 1 X 0
References Chapter 7, Fundamental of Digital Logic and Microcomputer Design – by M. Rafiquzzaman