Unit 3: Data Representation
Unit 3: Data Representation
Computer Organization 53
Unit 3 Data Representation
3.2 INTRODUCTION
468=4x102 + 6x101+8x100
54 Computer Organization
Data Representation Unit 3
Answer: 2 10
2 6 - 0
2 3 - 0
2 1 - 1
0- 1
2nd step:
So, (12) = (1100)
0.375
×2
0 . 750
×2
0
1 . 500
1 ×2
1 .000 (fraction becomes zero)
1
Therefore (0.375)10= (0.011)2 and (12.375)10= (1100.011)2
Computer Organization 55
Unit 3 Data Representation
56 Computer Organization
Data Representation Unit 3
…… AND SO ON.
Computer Organization 57
Unit 3 Data Representation
…AND SO ON.
58 Computer Organization
Data Representation Unit 3
Computer Organization 59
Unit 3 Data Representation
ii. Put 0 as the sign bit (the MSB, bit number 8) if the number is positive,
otherwise 1
iii. Separate the sign bit from the other bits by putting a comma (,)
For example,
(10)10=0, 0001010
(-10)10=1, 0001010
60 Computer Organization
Data Representation Unit 3
111
101 1+1 =0, Carry 1
1100 1+0+Carry 1=0, Carry 1
1+1+ Carry 1=1, Carry 1
1011
110 1+0=1
10001 1+1=0, Carry 1
0+1+Carry 1=0, Carry 1
1+Carry 1 =0, Carry 1
B. Subtraction of Binary Number
1. Subtract (101)2 from (111)2
111
-101 1-1 =0
010 1-0 =1
1-1 = 0
Computer Organization 61
Unit 3 Data Representation
123
567 3+7=10=12=2+Carry 1
712 2+6+Carry 1=9=11=1+Carry 1
1+5+Carry 1=7
62 Computer Organization
Data Representation Unit 3
D. Subtraction of Octal number
645
473 5-3=2
152 4-7+ Borrow 1=12-7=5
[In Octal Number system Borrow 1 value is 8]
5-4=1
511
123 1-3+Borrow 1=9-3=6
366 0-2+Borrow 1=8-2=6
4-1=3
E. Addition of Hexadecimal number
473
ADC 3+C =3+12=15
15B5 =5+ Carry 1
7+D+ Carry 1 =7+13+Carry 1
=21
=1B
= B + Carry 1
4+A+ Carry 1 =4+10+Carry1
=15
=5+Carry 1
Computer Organization 63
Unit 3 Data Representation
123
567 3+7=10=A
68A 2+6=8
1+5=6
F. Subtraction of Hexadecimal number
645
473 5-3=2
1D2 4-7+ Borrow 1=20-7=13=D
[In Hexadecimal Number system Borrow 1
value is 16]
5-4=1
511
123 1-3+Borrow 1=17-3=14=E
3EE 0-2+Borrow 1=16-2=14=E
4-1=3
64 Computer Organization
Data Representation Unit 3
Stack Pointer, Interrupt Block etc.), ALU, Memory unit, Control unit. There
are some buses for interconnecting the different components of CPU. The
registers, the ALU, and the interconnecting buses are collectively re-
ferred to as the data path. Each bit in data path is functionally identical.
The data path is capable of performing certain operations on data items.
We already know that there are some buses for interconnecting the
different components of CPU. Now the question is what is Bus? Collection
of wires or distinct lines is called Bus. There are three types of bus,
namely, Address Bus, Data Bus and Control Bus.
Data are stored in main memory against a memory location.
Address bus is responsible for carrying the address of the main memory
location from where the data can be accessed.
Data buses are used for transmission of data. Control Bus is
used for providing different types of control signals, to indicate the direc-
tion of data transfer and to coordinate the timing of events during the
transfer.
The other important components of data paths are as follows:
Accumulator: It is a very special register. Irrespective of the lo-
cation, the immediate input data will be available at Accumulator. And
after an arithmetic operation, the result will be available at the Accumu-
lator.
PC (Program Counter): It is responsible for holding the address
of the instruction to be executed next.
IR (Instruction Register): It stores or holds the instruction which
is current or executing.
Instruction Cache: ‘Fast’ memory where the next instruction
comes from Reg [index].
Arithmetic Logic Unit (ALU): It performs all the arithmetic and
logical operations.
Data Cache: Data read from or written to ‘fast’ memory.
Computer Organization 65
Unit 3 Data Representation
Multiplexer: Multiplexer has many Inputs and single out put line.
So, we can say that multiplexer is responsible for selecting one output
from multiple inputs based upon control signal(s).
Single-Cycle Data Path: Each instruction executes in one clock
cycle.
Multi-Cycle Data Path: Each instruction takes multiple clock
cycles.
Types of elements in the Data path are:
1. State element:
i. A memory element, i.e., it contains a state e.g.,
program counter, instruction memory
2. Combinational element:
i. Elements that operate on values e.g., adder, ALU
3. Now, we will look at data path elements required by the different
classes of instructions such as
i. Arithmetic and logical instructions
ii. Data transfer instructions
iii. Branch instructions
Q11. The registers, the ALU, and the interconnecting buses are
collectively referred to as the.............
66 Computer Organization
Data Representation Unit 3
Computer Organization 67
Unit 3 Data Representation
The design of data path with ALU is distinctly realized from the above figure.
ALU is connected with:
1. Accumulator. Data can transmit from ALU to Accumulator.
2. Instruction Register
3. Flag Register
4. And with the internal data bus.
Design of ALU is based on the points given below:
1. Instruction for a particular operation will come from instruction
register directly.
2. Data on which operation is to be performed i.e. the operand will
come to ALU from General Purpose Register (GPR) (or from
memory location).
68 Computer Organization
Data Representation Unit 3
Computer Organization 69
Unit 3 Data Representation
Computer Organization 71
Unit 3 Data Representation
Ans to Q No 5: Two
Ans to Q No 6: Three
Ans to Q No 7: Program Counter holds the address of the instruction to
be executed next.
Ans to Q No 8: Data Cache
Ans to Q No 9: Many, Single
Ans to Q No 10:16
Ans to Q No 11: Data Path
Ans to Q No 12: ALE
Ans to Q No 13: RESET OUT
72 Computer Organization