Unit-1 2
Unit-1 2
Unit-2
Computer Data Representation &
Register Transfer and Micro-
operations
[email protected]
Outline
Looping
• Basic computer data types & Complements
• Fixed point & Floating point representation
• Register transfer language
• Bus and Memory transfers (Three-State Bus Buffers, Memory Transfer)
• Arithmetic Micro-operations
• Logic Micro-operations
• Shift Micro-operations
• Arithmetic logical shift unit
Section - 1
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 4
Section - 2
Arithmetic Addition
+ 6 00000110 + 6 00000110
Using 1’s complement
+ 13 00001101 - 13 11110011
Using 2’s complement
+ 19 00010011 - 7 11111001
Arithmetic Subtraction
Using 1’s complement
Using 2’s complement Note: negative number must initially be in 2’s
complement
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 6
Floating point representation
Two parts
Mantissa – Represents signed fixed-point number
Exponent – Represents position of the decimal point
For example, the decimal number +6132.789 is represented in floating-point with a fraction
and an exponent as follows:
Fraction Exponent
+0.6132789 +04
The value of the exponent indicates that the actual position of the decimal point is four
positions to the right of the indicated decimal point in the fraction.
Floating-point is always interpreted to represent a number in the following form: m X re
Here, m stands for mantissa, e stands for exponent, r means radix
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 7
Floating point representation
Normalization
A floating point number is said to be normalized if the most significant digit of the mantissa is nonzero.
For example, the decimal number 350 is normalized but 00035 is not.
ANSI 32-bit floating point byte format
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 8
Section - 3
7 6 5 4 3 2 1 0
Register R Showing individual bits
15 0 15 8 7 0
PC (H) PC (L)
Numbering of bits Divided into two parts
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 10
Register Transfer Language
Information transfer from one register to The symbolic notation used to describe the
another is designated in symbolic form by microoperation transfers among registers is
means of a replacement operator is known called a register transfer language.
as Register Transfer. The term "register transfer" implies the
The statement availability of hardware logic circuits that
𝑅2← 𝑅1 can perform a stated microoperation and
transfer the result of the operation to the
denotes a transfer of the content of same or another register.
register 𝑅1 into register 𝑅2. A register transfer language is a system for
expressing in symbolic form the
R1 1 1 0 1 microoperation sequences among the
registers of a digital module.
R2 1 1 0 1
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 11
Register Transfer with Control Function
Normally, we want the transfer to occur only under a predetermined control condition using
if-then statement.
If (P = 1) then (𝑅2←𝑅1)
where P is a control signal generated in the control section.
A control function is a boolean variable that is equal to 1 or 0. The control function is
included in the statement as follows:
t t+1
Clock
Control P Load
circuit 𝑅2
n
Load
𝑅1 Transfer occurs here
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 12
Section - 4
D2 C2 B2 A2 D1 C1 B1 A1 D0 C0 B0 A0
D2 D1 D0 C2 C1 C0 B2 B1 B0 A2 A1 A0
3 2 1 0 3 2 1 0 3 2 1 0 3 2 1 0
Register D Register C Register B Register A
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 15
Common Bus System for 4 registers
The construction of a bus system for four registers is explained earlier.
Each register has four bits, numbered 0 through 3.
The bus consists of four 4 x 1 multiplexers each having four data inputs, 0 through 3, and two
selection inputs, S1 and S0.
The diagram shows that the bits in the same significant position in each register are
connected to the data inputs of one multiplexer to form one line of the bus.
The two selection lines S1 and S0 are connected to the selection inputs of all four
multiplexers.
The selection lines choose the four bits of one register and transfer them into the four-line
common bus.
When S1S0 = 00, the 0 data inputs of all four multiplexers are selected and applied to the
outputs that form the bus.
This causes the bus lines to receive the content of register A since the outputs of this register
are connected to the 0 data inputs of the multiplexers.
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 16
Common Bus System for 4 registers
Table shows the register that is selected by the
bus for each of the four possible binary values of
the selection lines.
In general, a bus system will multiplex k registers S1 S0 Register
Selected
of n bits each to produce an n-line common bus.
0 0 A
The number of multiplexers needed to construct
0 1 B
the bus is equal to n, the number of bits in each
1 0 C
register.
1 1 D
The size of each multiplexer must be k x 1 since it
multiplexes k data lines.
For example, a common bus for eight registers of
16 bits requires
Multiplexers - 16 of (8 x 1)
Select Lines - 3
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 17
ARITHMETIC MICRO-OPERATIONS
Arithmetic Microoperations
Arithmetic microoperations perform arithmetic operations on numeric data stored in
registers.
Symbolic Description
Designation Add Microoperation
Contents of plus transferred to 𝑅 3 ← 𝑅 1+𝑅 2
Contents of minus transferred to
Complement the contents of (1’s complement)
Subtract Microoperation
2’s complement the contents of (negate)
𝑅 3← 𝑅 1− 𝑅 2
plus the 2’s complement of (subtraction)
𝑅 3 ← 𝑅 1+𝑅 2+1
Increment the content of by one
Decrement the content of by one
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 19
4-bit Binary Adder
The digital circuit that generates the arithmetic sum of two binary numbers of any length is
called a binary adder.
Example 0 1 1 1
1 1 0 1
B3 A3 B2 A2 B1 A1 B0 A0
1 1 1 0
C 1 1 1 0 C3 C2 C1 C0
FA FA FA FA
R1 1 1 0 1 A
R2 + 0 1 1 1 B
Sum 1 0 1 0 0 C4 S3 S2 S1 S0
1 0 1 0 0
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 20
The binary adder is constructed with full-adder circuits connected in cascade, with the
output carry from one full-adder connected to the input carry of the next full-adder.
The figure shows the interconnections of four full-adders (FA) to provide a 4-bit binary adder.
The augends bits of A and the addend bits of B are designated by subscript numbers from
right to left, with subscript 0 denoting the low-order bit.
The carries are connected in a chain through the full-adders.
The input carry to the binary adder is C0 and the output carry is C4.
The S outputs of the full-adders generate the required sum bits.
An n-bit binary adder requires n full-adders.
The output carry from each full-adder is connected to the input carry of the next-high-order
full-adder.
The n data bits for the A inputs come from one register (such as R1), and the n data bits for
the B inputs come from another register (such as R2). The sum can be transferred to a third
register or to one of the source registers (R1 or R2), replacing its previous content.
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 21
4-bit Binary Adder-Subtractor
when M = 0 the circuit is an Adder When M = 0, we have When M = 1, we have
when M = 1 the circuit becomes a Subtractor C0 = 0 & B ⊕ 0 = B C0 = 1 & B ⊕ 1 = B’
B3 A3 B2 A2 B1 A1 B0 A0
1 0
1 0 1 0 1 0 1 0 M
B 3’ B 3 B 2’ B 2 B 1’ B 1 B 0’ B 0
C3 C2 C1 C0
FA FA FA FA
C4 S3 S2 S1 S0
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 22
4-bit Binary Incrementer
The increment microoperation adds one to a number in a register.
1 1 0 1
A3 A2 A1 A0 1
0 0 1
x y x y x y x y
C 0 0 1
R1 1 1 0 1 HA HA HA HA
+ 1
Sum 1 1 1 0 C S C S C S C S
C4 S3 S2 S1 S0
0 1 1 1 0
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 23
4-bit Arithmetic Circuit
The arithmetic micro operations can be implemented in one composite arithmetic circuit.
The basic component of an arithmetic circuit is the parallel adder.
By controlling the data inputs to the adder, it is possible to obtain different types of
arithmetic operations.
The output of binary adder is calculated from arithmetic sum.
𝑫=𝑨+𝒀+𝑪𝒊𝒏
Decrement using 2’s complement
1 1 1
1 1 0 1 1 1 0 1
- 1 2’s complement
+ 1 1 1 1 𝑫 𝒆𝒄𝒓𝒆𝒎𝒆𝒏𝒕= 𝑨+𝟏𝟏𝟏𝟏+𝟎
1 1 0 0 1 1 1 0 0
Discard carry
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 24
4-bit Arithmetic Circuit
Decremented content of A
D0 D1 D2 D3 Cout
0
C0 C1 C1 C2 C2 C3 C3 C4
FA FA FA FA
X0 Y0 X1 Y1 X2 Y2 X3 Y3
1 1 1 1
4x1 4x1 4x1 4x1
MUX MUX MUX MUX
S1 S 0 0 1 2 3 S1 S 0 0 1 2 3 S1 S 0 0 1 2 3 S1 S 0 0 1 2 3
0 0
Cin A0 B0 A1 B1 A2 B2 A3 B3
1 S1 S0 1
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 25
4-bit Arithmetic Circuit
Hardware implementation consists of:
4 full-adder circuits that constitute the 4-bit adder and four multiplexers for choosing
different operations.
There are two 4-bit inputs A and B.
The four inputs from A go directly to the X inputs of the binary adder. Each of the four inputs
from B is connected to the data inputs of the multiplexers. The multiplexer’s data inputs also
receive the complement of B.
The other two data inputs are connected to logic-0 and logic-1.
Logic-0 is a fixed voltage value (0 volts for TTL integrated circuits)
Logic-1 signal can be generated through an inverter whose input is 0.
The four multiplexers are controlled by two selection inputs, S1 and S0.
The input carry Cin goes to the carry input of the FA in the least significant position. The other
carries are connected from one stage to the next.
4-bit output D0…D3
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 26
4-bit Arithmetic Circuit
When S1S0 = 00
If Cin = 0 then D = A + B; Add
If Cin = 1 then D = A + B + 1; Add with carry
When S1S0 = 01
If Cin = 0 then D = A + ; Subtract with borrow
If Cin = 1 then D = A + + 1; A + 2’s complement of B i.e. A - B
When S1S0 = 10
Input B is neglected and all 0’s are inserted to Y inputs
D = A + 0 + Cin
If Cin = 0 then D = A; Transfer A
If Cin = 1 then D = A + 1; Increment A
When S1S0 = 11
Input B is neglected and all 1’s are inserted to Y inputs
D = A - 1 + Cin
June15,If2024
C = 0 then D = A - 1; 2’s compliment
Computer Data Representation & Register Transfer and Micro-operation 27
4-bit Arithmetic Circuit
Arithmetic Circuit Function
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 28
Section - 6
LOGIC MICRO-OPERATIONS
Logic Microoperations
Logic micro operations specify binary operations for strings of bits stored in registers.
These operations consider each bit of the register separately and treat them as binary
variables.
Example
𝑃 : 𝑅1← 𝑅1⨁ 𝑅2
R1 1 0 1 0
R2 ⨁ 1 1 0 0
R1 after P = 1 0 1 1 0
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 30
Logic Microoperations
Boolean Microoperation Name
Boolean Microoperation Name Function
Function
NOR
Clear
Exclusive-NOR
AND
Complement B
Transfer A
Complement A
Transfer B
Exclusive-OR NAND
OR Set to all 1’s
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 31
Hardware Implementation of Logic Circuit
S1
S0 S1 S0 Output Operation
Ai 0 0 AND
0
Bi
0 1 OR
4x1
1 Ei
MUX 1 0 XOR
2
1 1 Complement
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 32
Applications of Logic Microoperations
Logic microoperations are very useful for manipulating individual bits or a portion of a word
stored in a register. They can be used to change bit values, delete a group of bits, or insert
new bit values into a register.
1. Selective Set Operation
The selective-set operation sets to 1 the bits in register A where there are corresponding 1's
in register B.
It does not affect bit positions that have 0's in B.
The OR microoperation can be used to selectively set bits of a register.
1 0 1 0 A before
1 1 0 0 B (logic operand)
1 1 1 0 A after
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 33
Applications of Logic Microoperations
2. Selective Complement Operation
The selective-complement operation complements bits in register A where there are
corresponding 1's in register B.
It does not affect bit positions that have 0's in B.
The exclusive - OR microoperation can be used to selectively set bits of a register.
1 0 1 0 A before
1 1 0 0 B (logic operand)
0 1 1 0 A after
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 34
Applications of Logic Microoperations
3. Selective Clear Operation
The selective-clear operation clears to 0 the bits in register A only where there are
corresponding 1's in register B.
It does not affect bit positions that have 0's in B.
The corresponding logic microoperation is A ← A ∧ B’.
1 0 1 0 A before
1 1 0 0 B (logic operand)
0 0 1 0 A after
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 35
Applications of Logic Microoperations
4. Mask Operation
The mask operation is similar to the selective-clear operation except that the bits of register
A are cleared only where there are corresponding 0’s in register B.
The mask operation is an AND microoperation.
1 0 1 0 A before
1 1 0 0 B (logic operand)
1 0 0 0 A after
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 36
Applications of Logic Microoperations
5. Insert Operation
The insert operation inserts a new value into a group of bits.
This is done by first masking and then ORing them with required value.
The mask operation is an AND microoperation and the insert operation is an OR
microoperation.
Mask Insert
A 0110 1010 A 0000 1010
B 0000 1111 B 1001 0000
A 0000 1010 A 1001 1010
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 37
Applications of Logic Microoperations
6. Clear Operation
The clear operation compares the words in register A and register B and produces an all 0’s
result if the two numbers are equal.
This operation is achieved by an exclusive-OR microoperation.
1 0 1 0 A
1 0 1 0 B
0 0 0 0 A←A⊕B
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 38
Section - 7
SHIFT MICRO-OPERATIONS
Shift Microoperations
Shift microoperations are used for serial transfer of data.
Used in conjunction with arithmetic, logic and other data processing operations.
The content of the register can be shifted to the left or the right.
The first flip-flop receives its binary information from the serial input.
The information transferred through the serial input determines the type of shift.
Types of Shift
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 40
Types of Shift
1. Logical Shift
A logical shift is one that transfers 0 through the serial input.
R1 1 1 0 1 R1 1 1 0 1
R1 1 0 1 0 R1 0 1 1 0
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 41
Types of Shift
2. Circular Shift
A circular shift (also known as a rotate operation) circulates the bits of the register around
the two ends without loss of information.
This is accomplished by connecting the serial output of the shift register to its serial input.
R1 1 1 0 1 R1 1 1 0 1
R1 1 0 1 1 R1 1 1 1 0
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 42
Types of Shift
3. Arithmetic Shift
An arithmetic shift is a micro-operation that shifts a signed binary number to the left or right.
An arithmetic shift-left multiplies a signed binary number by 2.
An arithmetic shift-right divides the number by 2.
R1 1 1 0 1 R1 1 1 0 1
R1 1 0 1 0 R1 1 1 1 0
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 43
4 - bit Combinational Circuit Shifter
0 – Shift right
Select 1 – Shift left
0
S 0 H0
IR 0 MUX
1
1
A0 H0 H1 H2 H3
1 S
A1 S
1 H1
0 0 MUX 0 IR A0 A1 A2
A2 1
1 A1 A2 A3 IL
1
A3 S 1 H2
0 MUX
1
S
0 MUX
0 H3
IL 1
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 44
4 - bit Combinational Circuit Shifter
The 4-bit shifter has four data inputs, A0 through A3 and four data outputs, H0 through H3.
There are two serial inputs, one for shift left (IL) and the other for shift right (IR).
When the selection input S = 0, the input data are shifted right (down in the diagram).
When S = 1, the input data are shifted left (up in the diagram).
The two serial inputs can be controlled by another multiplexer to provide the three possible
types of shifts.
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 45
Section - 8
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 47
4 - bit Arithmetic Logic Shift Unit
S3
S2
S1 Ci
S0
One stage of Di
arithmetic
circuit
Select
0 4x1 Fi
Ci +1 1 MUX
2
3
One stage of Ei
Bi logic circuit
Ai
Ai-1 shr
Ai+1 shl
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 48
4 - bit Arithmetic Logic Shift Unit
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 49
Assignment
1. What do you mean by register transfer? Explain in detail. Also discuss three-state bus buffer.
2. List and explain types of shift operations on accumulator.
3. Define RTL. Explain how register transfer takes place in basic computer system
4. What is multiplexing? Explain the multiplexing of control signals in ALU.
5. Explain how complement number system is useful in computer system. Discuss any one
complement number system with example.
6. Draw the block diagram of 4-bit arithmetic circuit and explain it in detail.
7. Explain shift micro operations and Draw neat and clean diagram for 4-bit combinational circuit
shifter.
8. Explain hardware implementation of common bus system using three state buffers. Mention
assumptions if required.
9. Explain 4-bit adder-subtractor with diagram.
10. Explain floating point representation.
11. What is a Digital Computer System? Explain the role of binary number system in it.
12. Design a digital circuit for 4-bit binary adder.
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 50
Assignment
13. Represent (8620)10 in (1) binary (2) Excess-3 code and (3) 2421 code.
14. Explain selective set, selective complement and selective clear.
15. How negative integer number represented in memory? Explain with suitable example.
16. Explain Micro operation.
17. What does this mean: R2 ← R1?
18. What does this mean: T0: R4 ← R0?
19. What is a Bus?
20. What is an ALU?
21. Represent the following conditional control statement(s) by two register transfer
statements with control function. If (P=1) then (R1 ← R2) else if (Q=1) then (R1 ← R3)
22. State true or false: In binary number system, B - A is equivalent to B + A' + 1.
23. Draw a diagram of 4-bit binary incrementer and explain it briefly.
June 15, 2024 Computer Data Representation & Register Transfer and Micro-operation 51