Unit 1.1 Data Formats
Unit 1.1 Data Formats
Data Formats
By
KAORA/ KUNDA/CHILUMBU
Objectives
Understand how data is
represented, and stored, inside
a computer.
Understand how data is
manipulated inside a computer.
◼ General Considerations
◼ Number systems and Inter-conversion
◼ Internal Computer Data format
Key Terms you must be able to use
◼ Computers
◼ Process and store all forms of data in binary format.
◼ Data formats
◼ Specifications for converting data into computer-usable
form.
◼ Define the different ways human data may be
represented, stored and processed by a computer.
Digital vs. Analog
1 1 Threshold
1 1 1 1 1 1
0 0 0 0 0 0 0 0
Digital Signal
Digital Signal Degradation
= 3000 + 600+70+0.3+0.01
= 3672.31
We the proceed with performing all sorts of
mathematical operations on these numbers.
Binary Number System
• This numbers system uses radix of 2 so
that there are only two symbols (1 and 0
called bits) used to represent all
numbers. Example is a number such as
101.11
• The place values of each bit is
−1 −2
1x 2 + 0 x 2 + 1x 2 + 1x 2 + 1x 2
2 1 0
Binary Number System
13.37510
Such problems are solved by repeated division
and repeated multiplication by 2
Decimal to binary Conversion
We treat the whole number part and decimal part
separately 1110 0.625 10
2 11 C
0.625 x 2 = 0.25 1
2 51 0.25 x 2 = 0.5 0
2 21 10112 0.5 x 2 = 0 1
2 1 0 101
01 11.62510 = 1011.1012
Decimal to binary Conversion
Class activity
1310 0.37510
−1 −2
127.24 = 1x8 + 2 x8 + 7 x8 + 2 x8 + 4 x8
2 1 0
= 87.3125 in base 10
DECIMAL TO OCTAL
CONVERSION
This done by repeated division by 8 for whole
numbers and repeated multiplication by 8 for
decimal numbers
5 3
1010112 = 538
BINARY TO OCTAL CONVERSION
Show that 1111101112 = 7678
10101.112 = 25.68
OCTAL TO BINARY TO CONVERSION
In this case each digit in the given octal number is
converted to its binary triplet as follows
8 12 but 12 is C in hexadecimal
10001100 2 = 8C16
BINARY TO HEXA CONVERSION
Example: Convert 1011010111 from base 2 to base
16
0010 1101 0111
2 13 7
but 13 is D in hexadecimal
10110101112 = 2 D716
HEXA TO DECIMAL CONVERSION
This done by summation of powers of 16
Example: Convert F6D9 from base 16 to base 10
= 6319310
DECIMAL TO HEXA CONVERSION
This done by repeated division by 16 for whole
numbers and repeated multiplication by 16 for
decimal numbers. Convert 1983 to base 16
10
16 1983
16 123 15( F )
16 7 11( B)
0 7
198310 = 7 BF16
Binary Conversion (BIT class)
◼ Decimal to Binary
◼ 2510 = 1 10012
◼ 14510 = 1001 00012
◼ 210 = 102
◼ Binary to Decimal
◼ 1111 00002 = 24010
◼ 11112 = 1510
◼ 1002 = 410
Binary Conversion
◼ Octal to Binary
◼ 258 = 010 1012
◼ 1458 = 001 100 1012
◼ 28 = 0102
◼ Binary to Octal
◼ 1111 00002 = 3608
◼ 11112 = 178
◼ 1002 = 48
Binary Conversion
◼ Hexadecimal to Binary
◼ 2516 = 0010 01012
◼ 14516 = 0001 0100 01012
◼ 216 = 00102
◼ Binary to Hexadecimal
◼ 1111 00002 = F016
◼ 11112 = F16
◼ 1002 = 416
Addition and Subtraction of Binary Numbers – Signed
Magnitude (BICT with Education Class afternoon
today)
16 8 4 2 1
0 0 1 1 0
Magnitude
Sign
-6 1 1 1 0
Flip 0 to 1
◼ Signed numbers
8 4 2 1
0 1 1 1 = +7
+ 1 1 1 1 = -7
1 1 1 1 0 =0
14
The calculation after conversion gives a wrong number, hence the use of the 2’s Complement
Binary Conversion
◼ 2’s Complement
+2510 = 1 10012
-2510 = ?
1 10012 (+25)
0 01102 (flip the bits)
+ 1 (add 1)
0 0111
-2510 = 111001112
Examples
-12 and -15
Binary Conversion – Fractional Numbers to Decimal
◼1011.1010
1 * 2-1 = 0.500
1 * 2-3 = 0.125
1 * 20 = 1
1 * 21 = 2
1 * 23 = 8
11.62510 Answer
Binary Coded Decimal
Practice
Convert 0111 0101 1000BCD to decimal.
Binary Conversion
Step 4. Step 3.
After processing, the binary code for the
The signal for the capital letter D is converted
capital letter D is converted to an image, to its ASCII binary code (01000100) and is
and displayed on the output device. stored in memory for processing.
Summary of Main Teaching Points
◼ OSI Model
Question and Answer Session
Q&A