Arithmatic Algorithms Computer Organization and Architecture by Ravinder Nath Rajotiya - June 1, 2021December 23, 20220 Binary Multiplication Binary multiplication is is explained using two approaches Using the simple binary multiplication Using the Binary 2's complement Booth's Multiplication Algorithm first we explain using the first approach Simple binary multiplication Fig: Binary multiplication Algo Example-1: Multiply 22 and 21 using binary multiplication algorithm explain figure above Multiplicand Register B = 22 = 10110 Multiplier Register Q = 21= 10101 Step Qn Operation Carry (E) Acc (A) Multiplier (Q) Count initialize x x 0 00000 10101 5 1, 1, A=A+B 00000 10110 --------- 10110 Shr EAQ 0 01011 01010 4 2 0 Shr EAQ 0 00101 10101 3 3 1 Add 0 00101 10110 -------- 11011 Shr EAQ 0 01101 11010 2 4 0 Shr EAQ 0 00110 11101 1 5 1 Add 0 00110 10110 -------- 11100 Shr EAQ 0 01110 01110 0 ANSWER 22 x 21 = 462 = 00111001110 Example-2 : Multiply 30 and 26 using Binary Multiplication Algorithm Multiplicand Register B = 30 = 11110 Multiplier Register Q = 26= 11010 Step Qn Operation Carry (E) Acc (A) Multiplier (Q) Count initialize x x 0 00000 11010 5 1, 0 Shr EAQ 0 00000 01101 4 2 1 Add A, B 0 00000 11110 -------- 11110 Shr EAQ 0 01111 00110 3 3 0 Shr EAQ 0 00111 10011 2 4 1 Add 1 00111 11110 -------- 00101 10011 Shr EAQ 0 10010 11001 1 5 1 Add 1 10010 11110 --------- 10000 0 Shr EAQ 0 11000 01100 0 ANSWER 30x26 = 780 = 01100001100 2’sComplement Multiplication Booth’s Algorithm Example multiply -12 x -20 using Booth's Algorithm Let multiplicand = -20 ; Reg B(-
Microprogrammed Control Unit Computer Organization and Architecture by Ravinder Nath Rajotiya - May 19, 2021December 19, 20220 Microprogram Control Unit As discussed in Control Unit topic, a control unit generates a binary control variable for executing a particular microoperations. The control unit can be a hardwired or microprogrammed control unit. A control word can be programmed to perform various operations on components of the system. A control unit whose control word is stored in the control memory which is usually a ROM is called as microprogram control unit. Each control word in the control memory contains within it a microinstruction. Every microinstruction specifies one or more micro-operations. A microprogram is written for every instruction supported by the CPU. Each instruction of a program causes the corresponding micro-program to be fetched and its control information extracted in a manner that resembles the
Control Unit Computer Organization and Architecture by Ravinder Nath Rajotiya - May 17, 2021December 18, 20220 Introduction A general purpose computer consist of Input-output units, processing unit and a memory unit. Input-output permits interaction with the physical world whereas the memory unit stores user program and the binary information. The functional part of a general purpose digital computer, its functional units, the interaction between the control and the processor and the types of the control logic. Figure-1 on top left shows the function parts of a general purpose digital computer as CPU, input-output devices and the memory unit. Functional unit of a CPU is shown in figure 2 top right as ALU, set of registers and the timing and the control logic. Basic Function of the control logic : to generate timing sequences. to take input from the external sources and
Instruction Cycle Computer Organization and Architecture by Ravinder Nath Rajotiya - May 17, 2021December 14, 20220 Instruction Cycle In a digital computer the instructions are stored in the memory. When an instruction is executed it goes through a sequence of operations called an instruction cycle. The total time taken by the computer in executing an instruction is called an instruction cycle. It may contain different subcycle such as machine cycle. An instruction under execution may take one or more machine cycle for its execution depending upon the format of the instruction. Figure shows the steps taken by an instruction during its execution. All these steps together constitute an instruction cycle. Phases of Instruction cycle: 1. Fetch an instruction from memory. 2. Decode the instruction. 3. Read the effective address from memory if the instruction has an indirect address.