0% found this document useful (0 votes)
50 views

IU 01. Numeric Data in Computer System: Module: Computer Systems Architecture Qualification

The document provides an overview of a module on numeric data in computer systems. It discusses representing numeric data in binary, octal, decimal, and hexadecimal number systems. Key topics covered include converting between these number systems using integers and fractions, signed numbers, floating point numbers, and representing different data types as bit patterns. The module aims to help learners understand how various types of data are represented and stored in computers. It contains 6 required instructional units on numeric data, boolean logic, computer system components, processor operations, assembly language, and the fetch-execute cycle.

Uploaded by

Thwin Htut Aung
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

IU 01. Numeric Data in Computer System: Module: Computer Systems Architecture Qualification

The document provides an overview of a module on numeric data in computer systems. It discusses representing numeric data in binary, octal, decimal, and hexadecimal number systems. Key topics covered include converting between these number systems using integers and fractions, signed numbers, floating point numbers, and representing different data types as bit patterns. The module aims to help learners understand how various types of data are represented and stored in computers. It contains 6 required instructional units on numeric data, boolean logic, computer system components, processor operations, assembly language, and the fetch-execute cycle.

Uploaded by

Thwin Htut Aung
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

Module: Computer Systems Architecture

Qualification: BTEC Level 3 90-credit Diploma in IT

IU 01. Numeric Data in Computer System

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

IU# IU Description Required/Optional


01 Numeric Data in Computer System Required
02 Boolean Logic Operations Required
03 Functions of Computer System Components Required
04 Principles of Processor Operations Required
05 Low-level Assembly Language Required
06 Fetch-execute Cycle Required
Contents
Required /
S. No. Topic Description
Optional
01 Numeric Data Required
02 Alphanumeric Data Required
03 Numeric Data in Computing Required
04 Number Systems and Their Representation Required
05 Converting Denary to Binary Using Integer Required
06 Converting Binary to Denary Using Integer Required
07 Converting Denary to Octal Using Integer Required
08 Converting Octal to Denary Using Integer Required
09 Converting Denary to Hexadecimal Using Integer Required
10 Converting Hexadecimal to Denary Using Integer Required
11 Converting Binary to Octal Using Integer Required
12 Converting Octal to Binary Using Integer Required
13 Converting Binary to Hexadecimal Using Integer Required
IU 01. Contents
Required /
S. No. Topic Description
Optional
14 Converting Hexadecimal to Binary Using Integer Required
15 Signed Numbers Required
16 Addition and Subtraction in Different Bases Required
17 Fractions in Different Bases Required
18 Converting Between Number Bases Using Fractions Required
19 Floating Point Numbers Required
20 Binary Coded Decimal (BCD) Required
21 Converting Between BCD and Decimal Required
22 Extended Binary Coded Decimal (EBCD) Required
23 ASCII Characters Required
24 Data as Bit Patterns Required
25 Representing Bit Patterns for Different Types of Data Required
Numeric Data in Computing

 Data and instructions cannot be entered and processed directly


into computers using human language.
 Data may be numbers, letters, special symbols, sound or pictures.
 It converted into machine-readable form.
 Human beings use decimal (base 10) number systems for counting
and measurements .
 Computers use binary (base 2) number system, from binary digital
components (known as transistors) operating in two states - on and
off.
 We also use hexadecimal (base 16) or octal (base 8) number
systems, as a compact form for represent binary numbers.
Number Systems and Their Representation

 Basically, there are 4 types of number system.


 Decimal Number System (or) Denary Number System
 Binary Number System
 Octal Number System
 Hexadecimal Number System

 Decimal (or) Denary Number System


 Base 10 (Ten digits from 0 to 9)
 Binary Number System
 Base 2 (0 or 1)
 Octal Number System
 Base 8 (0,1,2,3,4,5,6,7)
 Hexadecimal Number System
 Base 16 (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F)
 A for 10, B for 11, C for 12, D for 13, E for 14, F for 15
 Hex for short
Converting Binary to Denary Using Integer

To determine the value of a binary number (10012 and 1110012),


we can expand the number using the positional weights as follows:

1 0 0 12 𝑪𝒐𝒏𝒗𝒆𝒓𝒕 𝟏𝟏𝟎𝟏𝟐 𝒕𝒐 𝒊𝒕𝒔 𝒅𝒆𝒏𝒂𝒓𝒚 𝒆𝒒𝒖𝒊𝒗𝒂𝒍𝒆𝒏𝒕.

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

6 ∴ 𝑇ℎ𝑒 𝑐𝑜𝑛𝑣𝑒𝑟𝑡𝑒𝑑 𝑏𝑖𝑛𝑎𝑟𝑦 𝑛𝑢𝑚𝑏𝑒𝑟


3 0 𝑖𝑠: 110102
2

3
1 1
2

1
0 1
2
Converting Octal to Denary Using Integer

To determine the value of an octal number (3678 and 16018 ), we


can expand the number using the positional weights as follows:

3 6 78 𝑪𝒐𝒏𝒗𝒆𝒓𝒕 𝟑𝟔𝟕𝟖 𝒕𝒐 𝒊𝒕𝒔 𝒅𝒆𝒏𝒂𝒓𝒚 𝒆𝒒𝒖𝒊𝒗𝒂𝒍𝒆𝒏𝒕.

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

 To convert a decimal to its octal equivalent, the remainder method


can be used.
1. Divide the decimal number by the base 8.
2. Indicate the remainder to the right.
3. Continue dividing into each quotient until the divide operation produces a
zero quotient.
4. The base 8 number is the numeric remainder reading from the last division to
the first.
𝑪𝒐𝒏𝒗𝒆𝒓𝒕 𝒕𝒉𝒆 𝒅𝒆𝒄𝒊𝒎𝒂𝒍 𝒏𝒖𝒎𝒃𝒆𝒓 𝟒𝟔𝟓𝟏𝟎 𝒕𝒐 𝒊𝒕𝒔 𝒐𝒄𝒕𝒂𝒍 𝒆𝒒𝒖𝒊𝒗𝒂𝒍𝒆𝒏𝒕:

𝑫𝒊𝒗𝒊𝒔𝒊𝒐𝒏 𝑸𝒖𝒐𝒕𝒊𝒆𝒏𝒕 𝑮𝒆𝒏𝒆𝒓𝒂𝒕𝒆𝒅 𝑹𝒆𝒎𝒂𝒊𝒏𝒅𝒆𝒓


465
58 1
8

58
7 2
8

7 ∴ 𝑇ℎ𝑒 𝑐𝑜𝑛𝑣𝑒𝑟𝑡𝑒𝑑 𝑜𝑐𝑡𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟


0 7 𝑖𝑠: 7218
8
Converting Hexadecimal to Denary Using Integer

To determine the value of an hexadecimal number (20𝐵316 and


12𝐴𝐸516 ), we can expand the number using the positional weights
as follows:
2 0 𝐵 316 𝑪𝒐𝒏𝒗𝒆𝒓𝒕 𝟐𝟎𝑩𝟑𝟏𝟔 𝒕𝒐 𝒊𝒕𝒔 𝒅𝒆𝒏𝒂𝒓𝒚 𝒆𝒒𝒖𝒊𝒗𝒂𝒍𝒆𝒏𝒕.

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

 To convert a decimal to its hexadecimal equivalent, the remainder


method can be used.
1. Divide the decimal number by the base 16.
2. Indicate the remainder to the right.
3. Continue dividing into each quotient until the divide operation produces a
zero quotient.
4. The base 16 number is the numeric remainder reading from the last division
to the first.
𝑪𝒐𝒏𝒗𝒆𝒓𝒕 𝒕𝒉𝒆 𝒅𝒆𝒄𝒊𝒎𝒂𝒍 𝒏𝒖𝒎𝒃𝒆𝒓 𝟗𝟐𝟔𝟑𝟏𝟎 𝒕𝒐 𝒊𝒕𝒔 𝒉𝒆𝒙𝒂𝒅𝒆𝒄𝒊𝒎𝒂𝒍 𝒆𝒒𝒖𝒊𝒗𝒂𝒍𝒆𝒏𝒕:

𝑫𝒊𝒗𝒊𝒔𝒊𝒐𝒏 𝑸𝒖𝒐𝒕𝒊𝒆𝒏𝒕 𝑮𝒆𝒏𝒆𝒓𝒂𝒕𝒆𝒅 𝑹𝒆𝒎𝒂𝒊𝒏𝒅𝒆𝒓


9263
578 15 = 𝐹
16

578
36 2
16 𝑇ℎ𝑒 𝑐𝑜𝑛𝑣𝑒𝑟𝑡𝑒𝑑
36
ℎ𝑒𝑥𝑎𝑑𝑒𝑐𝑖𝑚𝑎𝑙 𝑖𝑠: 242𝐹16
2 4
16

2
0 2
16
Converting Binary to Octal Using Integer

 Divide the binary number into groups of 3 digits starting on the


right of the binary number.
 If the leftmost group has less than 3 bits, put in the necessary
number of leading zeroes on the left.
 For each group of three bits, write the corresponding single octal
digit.

 Example 1: 1101 0011011101112 = ?8


 Answer:
 Binary: 001 101 001 101 110 111
 Octal: 1 5 1 5 6 7

 Example 2: 1011011112 = ?8
 Answer:
 Binary: 101 101 111
 Octal: 5 5 7
Converting Octal to Binary Using Integer

 To convert from octal to binary, write the corresponding group of


three binary digits for each octal digit.

 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

 Divide the binary number into groups of 4 digits starting on the


right of the binary number.
 If the leftmost group has less than 4 bits, put in the necessary
number of leading zeroes on the left.
 For each group of three bits, write the corresponding single octal
digit.

 Example 1: 100100012= ?16


 Answer:
 Binary: 1001 0001
 Hexa: 9 1
 Example 2: 1010102 = ?16
 Answer:
 Binary: 0010 1010
 Hexa: 2 A
Converting Hexadecimal to Binary Using Integer

 To convert from hexadecimal to binary, write the corresponding


group of four binary digits for each hexadecimal digit.

 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

 Sign and Magnitude


 One-bit (leftmost bit) to indicate the sign.
 “0” represents positive sign and “1” represents negative sign.
 The rest of the bits represents the magnitude of the number.
 For example: 1001 1000 – red color 1 is negative sign indication,
purple colors are the magnitude 24.

 Two’s Complement Method


 It can be turned positive number to negative number.
 Two’s complement by taking one’s complement by adding one.
 For example: 101 (5 in binary) -> 010 (1’s complement) -> 011 (2’s
complement).
Signed Numbers

 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

-5-> 0101 -> 1010 -> +1 -> 1011


Binary Addition Using Integer

 Adding two binary numbers together is easy, keeping in mind


the following four addition rules:
 0+0=0
 0+1=1
 1+0=1
 1 + 1 = 10
1/ 1/ 1/
110 11 101
+011 +10 +101
1001 101 1110
Binary Subtraction Using Integer

 To perform binary subtraction, we will use the complement


method.
 Compute 10002 – 00112 Subtrahend

Minuend

Actually, we can process as 10002 + ( -00112 )

 Step: 1 Compute the 1's complement of 00112 by changing 0 to 1 (or) 1 to 0.


0011 1100
 Step:2 Add 1 to the 1’s complement of the subtrahend
1100 + 1 1101 (2’s complement)

 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

 If a column of two addends produces a sum greater than 7, you


must subtract 8 from the result, put down that result, and carry
the 1.
 Remember that there are no such digits as "8" and "9" in the
octal system, and that 810 = 108 , 910 = 118, etc.
 Add 5438 + 1218
543
+121
664
Answer: 5438 + 1218 = 6648 (no carry required)

 Add 76528 + 45748


7 6 5 2
+ 4 5 7 4
12 - 8 = 4 12 - 8 = 4 12 - 8 = 4
1 4 4 4 6
Answer: 76528 + 45748 = 144468
Octal Subtraction Using Integer

 To perform octal subtraction, we will use the complement


method.
 Compute 75268 – 31428 Subtrahend

Minuend

Actually, we can process as 75268 + ( -31428 )

 Step: 1 Compute the seven's complement of 31428 by subtracting each


digit from 7
7777 - 3142 4635 (7’s complement)

 Step:2 Add 1 to the 7’s complement of the subtrahend


4635 + 1 4636 (8’s complement)

 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

 If a column of two addends produces a sum greater than 15,


you must subtract 16 from the result, put down that result, and
carry the 1.
 Remember that A=10, B=11, C=12, D=13, E=14, F=15
 Add 19516 + 31916
195
+319
4AE
Answer: 19516 + 31916 = 4AE16 (no carry required)

 Add 3A216 + 41C16


3 A 2

+ 4 1 C

7 B E
Answer: 3A216 + 41C16 = 7BE16
Hexadecimal Subtraction Using Integer

 To perform hexadecimal subtraction, we will use the


complement method.
 Compute ABED16 – 1FAD16 Subtrahend

Minuend ABED16 + (-1FAD16)

 Step: 1 Compute the 15's complement of1FAD16 by subtracting each digit


from 7
FFFF – 1FAD E052 (15’s complement)

 Step:2 Add 1 to the 16’s complement of the subtrahend


E052 + 1 E053 (16’s complement)

 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

 Denary Fraction Number


 Use base 10 (from 0 to 9).
 As moving from right-to-left, each digit can also be ten times
smaller than its neighboring number.
 Once reaching zero (0) and the decimal point, can continue
moving from left-to-right along the digits are called Fractional
Numbers.

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.

 Floating Points Number


 Similar with scientific notation.
 Has 3 parts: Sign, Exponent and Mantissa.
 For example:

1 bit 3 bits 4 bits


Sign Exponent +3 Mantissa
Converting Binary Fraction to Decimal

Use base 2 (0 or 1).


Can use binary weighting for values of less than 1 producing are
called unsigned fractional binary numbers.
Here is an example of Unsigned Binary Fraction to Decimal
Fraction conversion.

Here is another example of converting 1101.01112 to its decimal


equivalent.
1101.0111 = (1×23) + (1×22) + (0×21) + (1×20) + (0×2-1) + (1×2-2) +
(1×2-3) + (1×2-4)
= 8 + 4 + 0 + 1 + 0 + 1/4 + 1/8 + 1/16
= 8 + 4 + 0 + 1 + 0 + 0.25 + 0.125 + 0.0625 = 13.437510
Converting Decimal Fraction to Binary
 The fractional (negative sequence from left-to-right) part of the
decimal number are calculated separately.
 Convert the decimal fraction 0.6875 to a binary fraction using
successive multiplication.
𝑪𝒐𝒏𝒗𝒆𝒓𝒕 𝒕𝒉𝒆 𝒅𝒆𝒄𝒊𝒎𝒂𝒍 𝒏𝒖𝒎𝒃𝒆𝒓 𝟓𝟒. 𝟔𝟖𝟕𝟓𝟏𝟎 𝒕𝒐 𝒊𝒕𝒔 𝒃𝒊𝒏𝒂𝒓𝒚 𝒇𝒓𝒂𝒄𝒕𝒊𝒐𝒏
𝒆𝒒𝒖𝒊𝒗𝒂𝒍𝒆𝒏𝒕:
𝑫𝒊𝒗𝒊𝒔𝒊𝒐𝒏𝑸𝒖𝒐𝒕𝒊𝒆𝒏𝒕 𝑹𝒆𝒎𝒂𝒊𝒏𝒅𝒆𝒓
54
27 0 𝑴𝒖𝒍𝒕𝒊𝒑𝒍𝒚 𝒃𝒚 𝟐 (𝑪𝒂𝒍𝒄𝒖𝒍𝒂𝒕𝒆 𝒇𝒓𝒂𝒄𝒕𝒊𝒐𝒏 𝒑𝒂𝒓𝒕)
2

27 0.6875 × 2 = 1.375 = 0.375 ( carry 1 )


13 1
2

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

For integer part, goes from right to left (80,81,82, etc.).


For fraction part, goes from left to right (8-1,8-2,8-3, etc.).
Here is an example conversion of 21.218 to its decimal equivalent.

 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

The equivalent decimal fraction number of 21.218 is: 17.26562510


Converting Decimal Fraction to Octal
 The fractional part of the octal number are calculated similarly as
binary.
 Convert the octal fraction 0.15625 to a octal fraction using
successive multiplication.
𝑪𝒐𝒏𝒗𝒆𝒓𝒕 𝒕𝒉𝒆 𝒅𝒆𝒄𝒊𝒎𝒂𝒍 𝒏𝒖𝒎𝒃𝒆𝒓 𝟒𝟔𝟓. 𝟏𝟓𝟔𝟐𝟓𝟏𝟎 𝒕𝒐 𝒊𝒕𝒔 𝒐𝒄𝒕𝒂𝒍 𝒇𝒓𝒂𝒄𝒕𝒊𝒐𝒏
𝒆𝒒𝒖𝒊𝒗𝒂𝒍𝒆𝒏𝒕:

Calculate integer part 𝑴𝒖𝒍𝒕𝒊𝒑𝒍𝒚 𝒃𝒚 𝟐 (𝑪𝒂𝒍𝒄𝒖𝒍𝒂𝒕𝒆 𝒇𝒓𝒂𝒄𝒕𝒊𝒐𝒏 𝒑𝒂𝒓𝒕)

𝑫𝒊𝒗𝒊𝒔𝒊𝒐𝒏𝑸𝒖𝒐𝒕𝒊𝒆𝒏𝒕 𝑹𝒆𝒎𝒂𝒊𝒏𝒅𝒆𝒓 0.15625 × 8 = 1.25


465
58 1 𝐼𝑛𝑡𝑒𝑔𝑒𝑟 𝑝𝑎𝑟𝑡 = 1 𝑐𝑎𝑟𝑟𝑦
8
𝐹𝑟𝑎𝑐𝑡𝑖𝑜𝑛 𝑝𝑎𝑟𝑡 = 0.25 (𝑝𝑟𝑜𝑐𝑒𝑒𝑑 𝑚𝑢𝑙𝑡𝑖𝑝𝑙𝑦 𝑏𝑦 8)
58
7 2
8
0.25 × 8 = 2.00
7 𝐼𝑛𝑡𝑒𝑔𝑒𝑟 𝑝𝑎𝑟𝑡 = 2 𝑐𝑎𝑟𝑟𝑦
0 7
8 𝐹𝑟𝑎𝑐𝑡𝑖𝑜𝑛 𝑝𝑎𝑟𝑡 = 0.00 (𝑠𝑡𝑜𝑝 𝑡ℎ𝑒 𝑝𝑟𝑜𝑐𝑒𝑠𝑠)

The octal equivalent of the decimal number:


465.1562510 is 721.128
Converting Hexadecimal Fraction to Decimal

For integer part, goes from right to left (160,161,162, etc.).


For fraction part, goes from left to right (16-1,16-2,16-3, etc.).
Here is an example conversion of EF.B116 to its decimal
equivalent.

 = 𝐸 × 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

The equivalent decimal fraction number of EF.B116 is: 239.69140610


Converting Decimal Fraction to Hexadecimal
 The fractional part of the hexadecimal number are calculated
similarly as binary and octal.
 Convert the octal fraction 0,00390625 to a hexadecimal fraction
using successive multiplication.
𝑪𝒐𝒏𝒗𝒆𝒓𝒕 𝒕𝒉𝒆 𝒅𝒆𝒄𝒊𝒎𝒂𝒍 𝒏𝒖𝒎𝒃𝒆𝒓 𝟗𝟐𝟔𝟑. 𝟎𝟎𝟑𝟗𝟎𝟔𝟐𝟓𝟏𝟎 𝒕𝒐 𝒊𝒕𝒔 𝒉𝒆𝒙𝒂𝒅𝒆𝒄𝒊𝒎𝒂𝒍 𝒇𝒓𝒂𝒄𝒕𝒊𝒐𝒏
𝒆𝒒𝒖𝒊𝒗𝒂𝒍𝒆𝒏𝒕:
𝑴𝒖𝒍𝒕𝒊𝒑𝒍𝒚 𝒃𝒚 𝟏𝟔 (𝑪𝒂𝒍𝒄𝒖𝒍𝒂𝒕𝒆 𝒇𝒓𝒂𝒄𝒕𝒊𝒐𝒏 𝒑𝒂𝒓𝒕)
𝑫𝒊𝒗𝒊𝒔𝒊𝒐𝒏𝑸𝒖𝒐𝒕𝒊𝒆𝒏𝒕 𝑹𝒆𝒎𝒂𝒊𝒏𝒅𝒆𝒓
9263
578 15 = 𝐹 0.00390625 × 16 = 0.0625
16
𝐼𝑛𝑡𝑒𝑔𝑒𝑟 𝑝𝑎𝑟𝑡 = 0 𝑐𝑎𝑟𝑟𝑦
578 𝐹𝑟𝑎𝑐𝑡𝑖𝑜𝑛 𝑝𝑎𝑟𝑡 = 0.0625(𝑝𝑟𝑜𝑐𝑒𝑒𝑑 𝑚𝑢𝑙𝑡𝑖𝑝𝑙𝑦 𝑏𝑦 16)
36 2
16

36 0.0625 × 16 = 1.000
2 4 𝐼𝑛𝑡𝑒𝑔𝑒𝑟 𝑝𝑎𝑟𝑡 = 1 𝑐𝑎𝑟𝑟𝑦
16
𝐹𝑟𝑎𝑐𝑡𝑖𝑜𝑛 𝑝𝑎𝑟𝑡 = 0.000 (𝑠𝑡𝑜𝑝 𝑡ℎ𝑒 𝑝𝑟𝑜𝑐𝑒𝑠𝑠)
2
0 2
16

Calculate integer part The hexadecimal equivalent of the decimal


number: 9263.0039062510 is 242F.0116
Floating Points Representation

 Computers which work with real arithmetic use a system called


floating point.
 A floating point number does not reserve a specific number of bits
for the integer part or the fractional part.
 Instead a computer word is divided into 3 fields, representing the
sign s, the exponent E, and the signicand or mantissa M
respectively.
 Very similar to using scientific notation:
5.5x102 = 550
In binary, we use the following:
101.1x22=1010

Exponent
Mantissa
Floating Points Representation

 Floating point numbers are usually stored in a register and split


into two parts.
 The two most common floating-point binary storage formats used
by Intel processors were created for Intel and later standardized by
the IEEE organization:
 IEEE Short Real: 32 bits - 1 bit for the sign, 8 bits for the
exponent, and 23 bits for the mantissa. Also called single
precision.
 IEEE Long Real: 64 bits - 1 bit for the sign, 11 bits for the
exponent, and 52 bits for the mantissa. Also called double
precision.
IEEE Formats

 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

IEEE 32-bit 1 8 23 127 6

IEEE 64-bit 1 11 52 1023 15

IEEE 128-bit 1 15 112 16383 34


8-bit Floating Point Representation

 For example, 5.5 10 = 101.12 = 1.011 2 x 22


 Add 3 to exponent 2 (+3=5) to arrive at 510 = 1012 for the exponent
bits.
 The mantissa bits (the bits following the decimal point of the
scientific notation is 011.
 0 101 0110 as the 8-bit representation of 5.510.
0 1 0 1 0 1 1 0

Mantissa Bits
Sign Bit Exponent Bits

 This is called floating-point representation because the values of


the mantissa bits “float” along with the decimal point, based on
the exponent's given value.
 But in fixed-point representation, the decimal point is always in
the same place among the bits given.
8-bit Floating Point Representation

 Convert -12.0 to our 8-bit floating point representation.


 1210 = 11002 (Binary Conversion)
 11002 x 20
 Normalize = > 1.100 x 23
 Sign Bit => 1 (because -12.0 so – sign must be 1)
 Mantissa => 100 (the bits which is the right side of decimal point)
 Exponent => 3 + 3 = 610 = 1102 (8 bit representation)

1 1 1 0 1 0 0 0

Exponent Bits Mantissa Bits


Sign Bit
Alphanumeric Data

 Binary Coded Decimal (BCD)


 It is represented decimal numbers with binary code (0 and 1).
 Each part of number is represented by four bits.
 For example: 5 -> 0101 (4 bits)
 Its advantage is that there is no limit to the size of the number.
 To add another bit, can easily add another four bit sequence.

 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)

The hexadecimal equivalent of the decimal


number: 9263.0039062510 is 242F.0116
Truth Table for BCD

Decimal Number BCD 8421 Code


0 0000 0000
1 0000 0001
2 0000 0010
3 0000 0011
4 0000 0100
5 0000 0101
6 0000 0110
7 0000 0111
8 0000 1000
9 0000 1001
10 (1+0) 0001 0000
11 (1+1) 0001 0001
12 (1+2) 0001 0010
13 (1+3) The hexadecimal
0001 0011equivalent of the decimal
number: 9263.0039062510 is 242F.0116
etc., continuing upwards in groups of four
Decimal-BCD Conversion

 Firstly, separate the decimal number into its weighted digits.


 Write down the equivalent 4-bit 8421 BCD code.
 Convert the following decimal (denary) numbers: 8510, 57210
and 857910 into their 8421 BCD equivalents.
84218421
 8510 = 1000 0101 (BCD)
8421 8421 8421
 57210 = 0101 0111 0010 (BCD)
8421 8421 8421 8421
 857910 = 1000 0101 0111 1001 (BCD)

The hexadecimal equivalent of the decimal


number: 9263.0039062510 is 242F.0116
BCD-to-Decimal Conversion

 It’s conversion is the exact opposite of the above.


 Divide the binary number into groups of four digits, starting with
the least significant digit
 Write the decimal digit represented by each 4-bit group.
 Add additional zero’s at the end if required to produce a complete
4-bit grouping.
 For example, 11 01012 would become: 0011 01012 or 3510 in
decimal.
 10012 = 1001BCD = 910
 10102 = this will produce an error as it is decimal 1010 and not a valid BCD
number.
 100 01112 = 0100 0111BCD = 4710

The hexadecimal equivalent of the decimal


number: 9263.0039062510 is 242F.0116
Extended Binary Coded Decimal (EBCD)

 Is an 8-bit character-coding scheme used primarily on IBM


computers.
 A total of 256 (28) characters can be coded using this scheme.

 For example, the symbolic representation of letter A using


Extended Binary Coded Decimal Interchange code is 110000012.

The hexadecimal equivalent of the decimal


number: 9263.0039062510 is 242F.0116
ASCII Characters
ASCII stands for American Standard Code for Information
Interchange.
 An ASCII code is the numerical representation of a character such
as 'a' or '@' or an action of some sort.
It was used with teletypes and so the descriptions are somewhat
obscure.
They can easily import the file into their own applications without
issues.
Notepad.exe creates ASCII text, or in MS Word you can save a file
as 'text only‘.

The hexadecimal equivalent of the decimal


number: 9263.0039062510 is 242F.0116
ASCII Table and Description

The hexadecimal equivalent of the decimal


number: 9263.0039062510 is 242F.0116
Data as Bit Patterns

 Memory in a computer consists of a very large number of


electronic 'circuits' which have one of two possible states:
 'ON' (represented by 1) or 'OFF' (represented by 0).
 For instance, 8 circuits which are in the states :
ON, ON, OFF, OFF, ON, OFF, OFF, ON
 This states could be represented by the digits as the following:
11001001
 Each 1 or 0 is called a BIT (short for BInary digiT).
 8 bits used together is known as a BYTE.

The hexadecimal equivalent of the decimal


number: 9263.0039062510 is 242F.0116
Data Representation in Digital Computers

 Data Representation in Digital Circuits


 Electronic components, such as microprocessor, are made up of millions of
electronic circuits.
 The high voltage(on) in these circuits is interpreted as ‘1’ while a low voltage
(off) is as ‘0’.

 Data Representation on Magnetic Media


 The presence of a magnetic field in one direction on magnetic media is
interpreted as 1; and the opposite direction is as “0”.

 Data Representation on Optical Media


 The presence of light is interpreted as ‘1’ while its absence is interpreted as
‘0’.
Representation of Characters

 Most computers use one byte (8 bits) to represent one character.


 A unique code for each character and one spare bit.
 The spare code as a parity bit that an extended character set
(eg which uses some graphic characters) is being used.
 Most PCs use ASCII (American Standard Code for Information
Interchange) codes.

 For example, character A is represented as binary code: 0100 0001


 Some mainframes use a code called EBCDIC (Extended Binary
Coded Decimal Interchange Code).

The hexadecimal equivalent of the decimal


number: 9263.0039062510 is 242F.0116
Representation of Graphics

 In a bitmap system, a graphic is composed of a large number of


pixels.
 Each pixel has a color and is stored as a bit pattern.
 For example, Each pixel may be stored as one byte giving a possible
256 different colors.
 Memory for storing graphics comes on a separate graphics card
specific to the type of monitor.
 For example, red color name is equivalent with the following hex
code and decimal code.

HTML / CSS Color Name Hex Code #RRGGBB Decimal Code (R,G,B)
red #FF0000 rgb(255,0,0)

The hexadecimal equivalent of the decimal


number: 9263.0039062510 is 242F.0116
Representation of Sounds
 Sound may be input using a microphone, CD, electronic keyboard
with MIDI (Musical Instrument Digital Interface).
 Sound waves are analogue and need to be converted to digital
signals before processing. 1. Measure value
of signal at equal
intervals

2. Assign a value
from a set to a
sample

3. Store converted
binary pattern

The hexadecimal equivalent of the decimal


number: 9263.0039062510 is 242F.0116
Representation of Images

Image

Bitmap Vector

 Bitmap graphic method divides an image into pixels.


 The resolution is the size of the pixels.
 As the resolution increases, the image quality will increase but more memory
will be needed to store the image.
 Vector graphics
 Does not store the bit pattern of an image because an image will be
represented using a mathematical formula which will be stored.
 An image is decomposed into a combination of curves and lines.
 Scaling is very easy.

The hexadecimal equivalent of the decimal


number: 9263.0039062510 is 242F.0116
Bitmap Method

Each pixel is assigned a bit pattern (0 for white, 1 for black)

To show 4 levels of gray scale, a pixel is represented by a 2-bit


pattern(00 black, 01 dark gray, 10 light dark gray, 11white)
The hexadecimal equivalent of the decimal
number: 9263.0039062510 is 242F.0116
Representation of Letters

 Letters are converted into numbers when you type on a keyboard


 The letters are stored (a Word document), retrieved (File/Open...),
processed (paper is revised), transmitted (submitted by email) and
printed on paper
 Encoding them as numbers is just assigning a numeric value to
 each one, without any intrinsic meaning.
 For example:
 Message “Hello” in ASCII
 01001000 01100101 01101100 01101100 01101111
 H e l l o

The hexadecimal equivalent of the decimal


number: 9263.0039062510 is 242F.0116
Representation of Colors

 TV & computer screens use Red-Green-Blue (RGB) model


 Each color is a combination of red, green, blue components.
 R+G = yellow, R+B = magenta, B+G = cyan, R+G+B = white

 For computers, color of a pixel is usually specified by three


 numbers giving amount of each color, on a scale of 0 to 255
 This is often expressed in hexadecimal.
 000000 is black, FFFFFF is white

 Printers use cyan-magenta-yellow[-black] (CMY[K])

The hexadecimal equivalent of the decimal


number: 9263.0039062510 is 242F.0116

You might also like