Chapter 2
Chapter 2
COMPUTER ORGANIZATION
&
ARCHITECTURE
CHAPTER TWO
Data Representation
04/23/2025 2
Numbering Systems
Most modern computer systems do not represent numeric values using the
decimal system.
Numbering system it uses is a specific radix (base 2).
Radices that are power of 2 are widely used in digital systems.
These radices include:
Binary (base 2),
Quaternary (base 4),
Octagonal (base 8),
Decimal (base 10) and
Hexagonal (base 16).
The base 2 binary system is dominant in computer systems.
04/23/2025 3
+ 1*2-3)
04/23/2025 5
2 43
2 21 rem 1 LSB
2 5 rem 0
2 2 rem 1
2 1 rem 0
04/23/2025 8
So, (0.1011)2
04/23/2025 9
The remaining (n-1) bits are used to represent the magnitude of the number.
For example, the negative number (-18) is represented using 6 bits, base 2 in
the sign-magnitude format, as follows (110010),
while a (+18) is represented as (010010).
Although the sign-magnitude representation is complicated when performing
arithmetic operations.
for example, the addition of the two numbers +18 (010010) and -19 (110011)
using the sign-magnitude representation.
Since the two numbers carry different signs, then the result should carry the
sign of the larger number in magnitude, in this case the (-19). The remaining 5-
bit numbers are subtracted (110011 - 010010) to produce (100001), that is, (-1).
04/23/2025 12
Radix Complement
According to this system:
The positive number is represented the same way as in the sign-magnitude.
But the negative number is represented using the b’s complement (b for base
numbers).
For example, the representation of the number (-19) using 2’s complement. In
this case, the number 19 is first represented as (010011). Then each digit is
complemented, hence the name radix complement to produce (101100).
Finally a “1” is added at the least significant bit position to result in (101101).
Example2: consider the 2’s complement representation of the number (+18).
Since the number is positive, then it is represented as (010010), the same as in
the sign-magnitude case.
04/23/2025 13
Example: (-7 )+ (+4)= -3 that is, (1001 )+ (0100) = 1101, a (-3) in 2’s
complement.
(+6)+(+7)=+13, that is, 0111 + (0110) = 1101, a wrong result. This is
because the result exceeds the largest value (+7).
Example2: (-7)+(-4)=-11 , that is, 1001+ (1100) = 0101, a wrong result. This is
because the result is less than the smallest value (-4). Notice that the original
numbers are negative while the result is positive.
04/23/2025 16
Solution:
Division:
Division of a pair of FP numbers X=mx * 2a and Y= my * 2b is represented as