Unit-II & III CSO (160311)
Unit-II & III CSO (160311)
Gwalior
Department of Information Technology
3
Course IC-Mrs. Neha Bhardwaj, Deptt. of IT, MITS
Sign magnitude numbers
4
Course IC-Mrs. Neha Bhardwaj, Deptt. of IT, MITS
One’s Complement Number
01110011 - 00011011
01110011 + 11100101 = 1 01011000 , discard this 1
answer is 01011000 i.e. 88
6
Course IC-Mrs. Neha Bhardwaj, Deptt. of IT, MITS
ADDITION AND SUBTRACTION
12
Course IC-Mrs. Neha Bhardwaj, Deptt. of IT, MITS
BOOTH MULTIPLICATION ALGORITHM
Ò The first bit is the sign bit, S, the next eight bits are the exponent bits, ‘E’, and
the final 23 bits are the fraction ‘F’ (Single Precision). Instead of the signed
exponent E, the value stored is an unsigned integer E’ = E + 127, called the
excess -127 format.
Ò 0 10000000 00000000000000000000000
= +1 * 2^(128-127) * 1.0 = 2
Ò 0 10000001 10100000000000000000000
= +1 * 2^(129-127) * 1.101 = 6.5
3.25 x 10 ^3
+ 2.63 x 10 ^ -1
—————–
first step: align decimal points
second step: add
3.25 x 10 ^ 3
+ 0.000263 x 10 ^ 3
——————–
3.250263 x 10 ^ 3
3.0 x 10 ^ 1
+ 0.5 x 10 ^ 2
—————–
3.0 x 10 ^ 1
+ 0.5 x 10 ^2
—————–
1.50 x 10 ^ 3
A bus organization for seven CPU registers is shown here (next slide). The output of
each register is connected to two multiplexers (MUX) to form the two buses A and B.
The selection lines in each multiplexer select one register or the input data for the
particular bus.
The A and B buses form the inputs to a common arithmetic logic unit (ALU).
The result of the micro-operation is available for output data and also goes into the
inputs of all the registers.
The register that receives the information from the output bus is selected by a
decoder.
Control Word
Ò The control unit that operates the CPU bus system directs the information
flow through the registers and ALU by selecting the various components in
the system. For example, to perform the operation
R1 <-- R2 + R3
the control must provide binary selection variables to the following selector
inputs:
Ò 1. MUX A selector (SELA): to place the content of R2 into bus A.
Ò The three bits of SELA select a source register for the A input of the ALU. The
three bits of SELB select a register for the B input of the ALU. The three bits
of SELD select a destination register using the decoder and its seven load
outputs. The five bits of OPR select one of the operations in the ALU.
22
Course IC-Mrs. Neha Bhardwaj, Deptt. of IT, MITS
STACK ORGANIZATION
24
Course IC-Mrs. Neha Bhardwaj, Deptt. of IT, MITS
INSTRUCTION FORMATS
PUSH C TOP = C
PUSH D TOP = D
LOAD A AC = M[A]
ADD B AC = AC + M[B]
STORE T M[T] = AC
LOAD C AC = M[C]
ADD D AC = AC + M[D]
MUL T AC = AC * M[T]
STORE X M[X] = AC
MOV R2, C R2 = C
ADD R2, C, D R2 = M[C] + M[D]
ADD R2, D R2 = R2 + D
MUL X, R1, R2 M[X] = R1 * R2
MUL R1, R2 R1 = R1 * R2
MOV X, R1 M[X] = R1
Ò The term addressing modes refers to the way in which the operand of an
instruction is specified.
Fetch
Decode
Indirect
Execution
Note : all instructions have Fetch and execution cycles. Some may have indirect
cycle also.
SYLLABUS
36
Course IC-Mrs. Neha Bhardwaj, Deptt. of IT, MITS
8085 CONFIGURATION
Ò Arithmetic and logic unit: It performs arithmetic and logical operations like
Addition, Subtraction, AND, OR, etc. on 8-bit data.
Ò Flag register: It is an 8-bit register having five 1-bit flip-flops, which holds
either 0 or 1 depending upon the result stored in the accumulator.
Ò These are the set of 5 flip-flops −
Ò Sign (S), Zero (Z), Auxiliary Carry (AC), Parity (P), Carry (C)
FLOW DIAGRAM à
41
Course IC-Mrs. Neha Bhardwaj, Deptt. of IT, MITS
Ò Input Address Data
8000 DC
8001 AC
Ò Output
Address Data
8050 93
8051 D0