IU 01. Numeric Data in Computer System: Module: Computer Systems Architecture Qualification
IU 01. Numeric Data in Computer System: Module: Computer Systems Architecture Qualification
By the end of this session, to enable learners to understand how various types of data can be represented and
then stored within computer systems.
Instructional Units in the Module
1 × 20 = 1 ×1 =1
0 × 21 = 0 ×2 =0
0 × 22 = 0 ×4 =0
1 × 23 = 1 ×8 =8
Converting a Binary to Decimal Using Integer 910
𝑪𝒐𝒏𝒗𝒆𝒓𝒕 𝟏𝟏𝟏𝟎𝟎𝟏𝟐 𝒕𝒐 𝒊𝒕𝒔 𝒅𝒆𝒏𝒂𝒓𝒚 𝒆𝒒𝒖𝒊𝒗𝒂𝒍𝒆𝒏𝒕.
1 1 1 0 0 12 1 × 20 = 1 × 1 = 1
0 × 21 = 0 × 2 = 0
0 × 22 = 0 × 4 = 0
1 × 23 = 1 × 8 = 8
1 × 24 = 1 × 16 = 16
1 × 25 = 1 × 32 = 32
5710
Converting Denary to Binary Using Integer
To convert a decimal to its binary equivalent, the remainder method can be used.
1. Divide the decimal number by the base 2.
2. Indicate the remainder to the right.
3. Continue dividing into each quotient until the divide operation produces a zero
quotient.
4. The base 2 number is the numeric remainder reading from the last division to
the first.
𝑪𝒐𝒏𝒗𝒆𝒓𝒕 𝒕𝒉𝒆 𝒅𝒆𝒄𝒊𝒎𝒂𝒍 𝒏𝒖𝒎𝒃𝒆𝒓 𝟐𝟔𝟏𝟎 𝒕𝒐 𝒊𝒕𝒔 𝒃𝒊𝒏𝒂𝒓𝒚 𝒆𝒒𝒖𝒊𝒗𝒂𝒍𝒆𝒏𝒕:
𝑫𝒊𝒗𝒊𝒔𝒊𝒐𝒏 𝑸𝒖𝒐𝒕𝒊𝒆𝒏𝒕 𝑮𝒆𝒏𝒆𝒓𝒂𝒕𝒆𝒅 𝑹𝒆𝒎𝒂𝒊𝒏𝒅𝒆𝒓
26
13 0
2
13
6 1
2
3
1 1
2
1
0 1
2
Converting Octal to Denary Using Integer
7 × 80 = 7 × 1 = 7
6 × 81 = 6 × 8 = 48
3 × 82 = 3 × 64 = 192
24710
𝑪𝒐𝒏𝒗𝒆𝒓𝒕 𝟏𝟔𝟎𝟏𝟖 𝒕𝒐 𝒊𝒕𝒔 𝒅𝒆𝒏𝒂𝒓𝒚 𝒆𝒒𝒖𝒊𝒗𝒂𝒍𝒆𝒏𝒕.
Converting a Binary to Decimal Using Integer
1 6 0 18
1 × 80 = 1 × 1 = 1
0 × 81 = 0 × 8 = 0
6 × 82 = 6 × 64 = 384
1 × 83 = 1 × 512 = 512
89710
Converting Denary to Octal Using Integer
58
7 2
8
3 × 160 = 3 × 1 = 3
11 × 161 = 11 × 16 = 176
0 × 162 = 0 × 256 = 0
2 × 163 = 2 × 4096 = 8192
837110
𝑪𝒐𝒏𝒗𝒆𝒓𝒕 𝟏𝟐𝑨𝑬𝟓𝟏𝟔 𝒕𝒐 𝒊𝒕𝒔 𝒅𝒆𝒏𝒂𝒓𝒚 𝒆𝒒𝒖𝒊𝒗𝒂𝒍𝒆𝒏𝒕.
Converting a Binary to Decimal Using Integer
1 2 𝐴 𝐸 516
5 × 160 = 5 × 1 = 5
14 × 161 = 14 × 16 = 224
10 × 162 = 10 × 256 = 2560
2 × 163 = 2 × 4096 = 8192
1 × 164 = 1 × 65536 = 65536
7651710
Converting Denary to Hexadecimal Using Integer
578
36 2
16 𝑇ℎ𝑒 𝑐𝑜𝑛𝑣𝑒𝑟𝑡𝑒𝑑
36
ℎ𝑒𝑥𝑎𝑑𝑒𝑐𝑖𝑚𝑎𝑙 𝑖𝑠: 242𝐹16
2 4
16
2
0 2
16
Converting Binary to Octal Using Integer
Example 2: 1011011112 = ?8
Answer:
Binary: 101 101 111
Octal: 5 5 7
Converting Octal to Binary Using Integer
Example 1: 17648 = ?2
Answer:
Octal: 1 7 6 4
Binary: 001 111 110 100
Example 2: 7318 = ?2
Answer:
Octal: 7 3 1
Binary: 111 011 001
Converting Binary to Hexadecimal Using Integer
Example 1: 3AB216 = ?2
Answer:
Hexadecimal: 3 A B 2
Binary: 0011 1010 1011 0010
Example 2: 1F77216 = ?2
Answer:
Hexadecimal: 1 F 7 7 2
Binary: 0001 1111 0111 0111 0010
Numeric Data
Use the MSB (Most Significant Bit) as a sign bit to display a positive
numbers or negative number.
In microelectronics, “1’s” and “0’s”, called a bit (being a contraction
of BInary digiT).
Adding signed numbers is not significantly different from adding
unsigned numbers. Decimal Signed Binary
-2 1/1/1/ (carry)
+3 1110
+1 +0011
1 0001
-5 0/1/1/ (carry)
+3 1011
-2 +0011
1110
0001
+1
0010
-2 -> 0010 -> 1101 -> +1 -> 1110
Minuend
Step:3 Add the 2's complement of the subtrahend to the minuend and drop
the high-order 1.
1000 + 1101 1 0 1 0 1(Answer)
Octal Addition Using Integer
Minuend
Step:3 Add the 8's complement of the subtrahend to the minuend and
drop the high-order 1.
7526 + 4636 1 4 3 6 4 (Answer)
Hexadecimal Addition Using Integer
+ 4 1 C
7 B E
Answer: 3A216 + 41C16 = 7BE16
Hexadecimal Subtraction Using Integer
Step:3 Add the 16's complement of the subtrahend to the minuend and
drop the high-order 1.
ABED + E053 1 8 C 4 0 (Answer)
Representing Fraction Numbers in Different Bases
7 × 10−3
6 × 10−2
5 × 10−1
4 × 100
3 × 101
2 × 102
1 × 103
Numeric Data
Fixed Point Decimal Number
It can support range and precision.
For example: 4.0, 112.5
It contains two parts: integer part and fraction part.
13
0.375 × 2 = 0.75 = 0.75 ( carry 0 )
6 1
2
0.75 × 2 = 1.50 = 0.5 ( carry 1 )
6
3 0
2
0.5 × 2 = 1.00 = 0.0 (carry 1)
3
1 1
2
1
The binary equivalent of the decimal number:
0 1 54.687510 is 110110.10112
2
Calculate integer part
Converting Octal Fraction to Decimal
2 × 81
+ 1 × 80
2 × 8 . −1
+ 1 × 8
−2
= 2 × 8 + 1 × 1 2 × . 1
8
+ 1 ×
1
64
= 16 + 1 . 0. 2 5 + 0 .0 1 5 6 2 5
= 17 + 0. 265625
= 17 . 26562510
= 𝐸 × 161 + 𝐹 × 160 . 𝐵 × 16 − 1 + 1 × 16 − 2
1 1
14 × 16 + 15 × 1 . 11 × ( 16) + 1 × ( 256)
= 224 + 15 . ( 0. 6 8 7 5 ) + ( 0 . 0 0 3 9 0 6 2 5 )
= 239 + 0. 6914
= 239 . 691406 10
36 0.0625 × 16 = 1.000
2 4 𝐼𝑛𝑡𝑒𝑔𝑒𝑟 𝑝𝑎𝑟𝑡 = 1 𝑐𝑎𝑟𝑟𝑦
16
𝐹𝑟𝑎𝑐𝑡𝑖𝑜𝑛 𝑝𝑎𝑟𝑡 = 0.000 (𝑠𝑡𝑜𝑝 𝑡ℎ𝑒 𝑝𝑟𝑜𝑐𝑒𝑠𝑠)
2
0 2
16
Exponent
Mantissa
Floating Points Representation
There are two major varieties of the standard, for 32 bits and
64 bits.
Format Sign Bit Exponent Mantissa Exponent Significant
Bits Bits Excess Digits
Our 8-bit 1 3 4 3 1
Our 16-bit 1 6 9 31 3
Mantissa Bits
Sign Bit Exponent Bits
1 1 1 0 1 0 0 0
ASCII Character
Character coding is represented by ASCII code.
It is represented as numbers (0-9) and letters (A-Z) in an encrypted
data format.
For example: the title of book “127 Hours” would be represented as
313237 20 486F757273.
Binary Coded Decimal (BCD)
Another process for converting decimal numbers into their binary
equivalents.
Many different binary codes used in digital and electronic circuits
for its own specific use.
For the 10 decimal digits (0-to-9), we need a 4-bit binary code.
Easy conversion between decimal (base-10) and binary (base-2)
form.
The disadvantage of BCD code is wasteful as the states between
1010 (decimal 10), and 1111 (decimal 15) are not used.
For instance,
35710 = 0011 0101 0111 (BCD)
HTML / CSS Color Name Hex Code #RRGGBB Decimal Code (R,G,B)
red #FF0000 rgb(255,0,0)
2. Assign a value
from a set to a
sample
3. Store converted
binary pattern
Image
Bitmap Vector