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

Lesson 01 - Numbering Systems

This document provides an overview of numbering systems used in computers, including binary, hexadecimal, and decimal. It discusses how binary numbers use a positional system based on powers of two rather than powers of ten in decimal. The document gives examples of converting between binary, hexadecimal, and decimal numbers. It also provides background on common binary numbers and their equivalent values in other numbering systems.

Uploaded by

ekong1912
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

Lesson 01 - Numbering Systems

This document provides an overview of numbering systems used in computers, including binary, hexadecimal, and decimal. It discusses how binary numbers use a positional system based on powers of two rather than powers of ten in decimal. The document gives examples of converting between binary, hexadecimal, and decimal numbers. It also provides background on common binary numbers and their equivalent values in other numbering systems.

Uploaded by

ekong1912
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 140

DATA REPRESENTATION

LESSON 01

NUMBERING SYSTEMS

COM211 - Computer Architecture 1


TEXT BOOK

The Essentials of Computer Organization and


Architecture, 2d ed., by Linda Null and Julia
Lobur (Sudbury, Mass.: Jones and Bartlett,
2006).

 Digital Design and Computer Architechure


by David Money Harris and Sarah l. Harris

Fundamentals of Computer Organization and


Architecture by Mostafa Abd-El-Barr and
Hesham El-Rewini COM211 - Computer Architecture 1
Change your mindset

COM211 - Computer Architecture 1


Overview
This section discusses several important
concepts including:
◦ The binary and hexadecimal numbering systems,
◦ Binary data organization (bits nibbles bytes words
and double words)
◦ Signed and unsigned numbering systems
◦ Arithmetic logical shift and rotate operations on
binary values
◦ Revision of Bit fields and packed data and the
ASCII character set.

COM211 - Computer Architecture 1


NUMBERING SYSTEMS

Have you ever wondered why 1 is called


ONE and 2 is called TWO?

COM211 - Computer Architecture 1


NUMBERING SYSTEMS

COM211 - Computer Architecture 1


Denary Numbers (Base 10)
 Normally we write numbers using ten digits
(0 to 9). This is called base 10.

 Base 10 numbers use a positional system


based on powers of 10 to indicate their value.
100 10 1
1 9 7

The number 197 is really 1 hundred + 9 tens + 7 ones.


The value of each position is determined by ever-higher
powers
of 10, read from left to right. COM211 - Computer Architecture 1
Binary Numbers
 However, any positive integer (whole
number) can be easily represented by a
sequence of 0's and 1's.

 Numbers in this form are said to be in base 2


and they are called binary numbers.

 Base 10 numbers use a positional system


based on powers of 10 to indicate their value.

COM211 - Computer Architecture 1


Binary Numbers
 The number 123 in base ten is really 1
hundred + 2 tens + 3 ones.
 The value of each position is determined by
ever-higher powers of 10, read from left to
right.
 Base 2 works the same way, just with
different powers.

 The number 101 in base 2 is really 1 four + 0


twos + 1 one (which equals 5 in base 10).
COM211 - Computer Architecture 1
Some numbers to always remember

25 = 32
2–4 = 0.0625 20 = 1
26 = 64
2–3 = 0.125 21 = 2
27 = 128
2–2 = 0.25 22 = 4
28 = 256
2–1 = 0.5 23 = 8
29 = 512
20 = 1 24 = 16
210 = 1,024

COM211 - Computer Architecture 1


Some numbers to always remember

Decimal 4-Bit Binary Hexadecimal


0 0000 0
1 0001 1
2 0010 2
3 0011 3
4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F

COM211 - Computer Architecture 1


Numbering Systems
Most modern computer systems use a binary
or two's complement numbering system.

A Review of the Decimal System
We are all used to the decimal (base 10)
numbering system

 When you see a number like "123" we don't


think about the value 123; rather we generate
a mental image of how many items this value
represents. COM211 - Computer Architecture 1
Numbering Systems
A Review of the Decimal System
◦ In reality however the number 123 represents:

◦ 1x102 + 2 x 101 + 3x100


or
◦ 100 + 20 + 3

COM211 - Computer Architecture 1


2.1 A Review of the Decimal System
Each digit appearing to the left of the decimal point
represents a value between zero and nine times an
increasing power of ten.

 Digits appearing to the right of the decimal point


represent a value between zero and nine times an
increasing negative power of ten.

For example the value 123.456 means:


◦ 1x102 + 2x101 + 3x100 + 4x10-1 + 5x10x-2 + 6x10-3

◦ or 100 + 20 + 3 + 0.4 + 0.05 + 0.006


COM211 - Computer Architecture 1
The Binary Numbering System
The binary numbering system works just like
the decimal numbering system with two
exceptions:
◦ Binary only allows the digits 0 and 1 (rather than
0-9) and

◦ Binary uses powers of two rather than powers of


ten.

 Therefore it is very easy to convert a binary


number to decimal.
COM211 - Computer Architecture 1
The Binary Numbering System
For each "1" in the binary string add in 2 n
where "n" is the zero-based position of the
binary digit.
 For example the binary value 11001010
represents:
128 64 32 16 8 4 2 1
1 1 0 0 1 0 1 0

= 1x27 + 1x26 + 0x25 + 0x24 + 1x23 + 0x22 + 1x21 + 0x20


= 128 + 64 + 8 + 2 = 202 (base 10)
COM211 - Computer Architecture 1
“Pure” Binary Numbers
 Pure binary represents numbers using just two digits (‘0’ and
‘1’) and columns, which increase by a factor of two.

 This is in contrast to our normal number system (denary),


which uses ten digits (0-9) and columns, and which increase
by a factor of ten.

 In denary the number one hundred and ninety seven is


represented as:
100 10 1
1 9 7
 In binary, it is represented as:

128 64 32 16 8 4 2 1
1 1 0 0 0 1 0 1
COM211 - Computer Architecture 1
Converting from Binary to Denary

A binary number, such as 1001 0101, can be converted


into its denary equivalent as follows:

 1).Write the binary number with the appropriate column


headings:
128 64 32 16 8 4 2 1
1 0 0 1 0 1 0 1

 2. Add the column headings under which there is a binary ‘1’:

= 128 + 16 + 4 + 1
= 149 COM211 - Computer Architecture 1
Converting from Binary to Denary
 A denary number, such as 107, can be converted into binary as follows:

 1. Write down the binary column headings:


128 64 32 16 8 4 2 1
 2. Then, starting from the left, ‘take out’ the values in the column headings, if possible:
128 cannot be taken out of 107 so that column contains a ‘0’:
128 64 32 16 8 4 2 1
0
 64 can be taken out of 107 so that column contains a ‘1’; this leaves 107 – 64 = 43:
128 64 32 16 8 4 2 1
0 1
 32 can be taken out of 43 so that column contains a ‘1’; this leaves 43 – 32 = 11:
128 64 32 16 8 4 2 1
0 1 1
 3. keep repeating the above process until the whole number has been converted to pure
binary:
128 64 32 16 8 4 2 1
0 1 1 0 1 0 1 1
COM211 - Computer Architecture 1
Converting Decimal to Binary Numbers
To convert decimal (denary) to binary

Example

Convert the decimal value 1359 to Binary:

COM211 - Computer Architecture 1


Converting from denary to binary
 A denary number, such as 1359, can be converted into binary as follows:
 1). Write down the binary column headings:
 2048 1024 512 256 128 64 32 16 8 4 2 1

 2). Then, starting from the left, ‘take out’ the values in the column headings, if possible:
 2048 cannot be taken out of 1359 so that column contains a ‘0’:
 2048 1024 512 256 128 64 32 16 8 4 2 1
 0
 3.) 1024 can be taken out of 1359 so that column contains a ‘1’;
this leaves 1359 – 1024 = 329:
 2048 1024 512 256 128 64 32 16 8 4 2 1
 0 1
 4). 256 can be taken out of 329 so that column contains a ‘1’; this leaves 329 – 256 = 73:
 2048 1024 512 256 128 64 32 16 8 4 2 1
0 1 0 1
 5). keep repeating the above process until the whole number has been converted to pure
binary:
 2048 1024 512 256 128 64 32 16 8 4 2 1
 0 1 0 1 0 1 0COM2110- Computer
1 Architecture
1 11 1
Alternative approach -
Conversion of the decimal value 1359 to
base two:

 First convert to base 16

 Then convert each Base 16 number to four


binary digits

 This method will be treated later

COM211 - Computer Architecture 1


Alternative approach -
Conversion of the decimal value 1359 to
base two:

 First convert to base 8

 Then convert each Base 8 number to three


binary digits

 This method will also be treated later

COM211 - Computer Architecture 1


Binary Formats
 It is normal to ignore any leading zeros.

 For example 101 (binary) represents the number


five (5).

We will zero extend all binary numbers to some


multiple of four or eight bits.

 Therefore following this convention we'd represent


the number five as:
0101 (binary) or 00000101 (binary).
COM211 - Computer Architecture 1
Binary Formats
 For readability, we will separate each group
of four binary bits with a space.

 For example the binary value

1010111110110010 will be written as:

1010 1111 1011 0010.

COM211 - Computer Architecture 1


Binary Formats
For convenience we'll assign a numeric value
to each bit position as follows:

◦ 1) The rightmost bit in a binary number is bit


position zero.

◦ 2) Each bit to the left is given the next successive


bit number.

◦ An eight-bit binary value uses bits zero through


seven like so: X7 X6 X5 X4 X3 X2 X1 X0

COM211 - Computer Architecture 1


Binary Formats
 A 16-bit binary value uses bit positions zero
through fifteen like so:
X15 X14 X13 X12 X11 X10 X9 X8 X7 X6 X5 X4 X3 X2 X1 X0

◦ Bit zero is usually referred to as the low order


( L.O.) bit.

◦ The left-most bit is typically called the high order (


H.O.) bit.

◦ While the intermediate bits are referred to by their


respective bit numbers. COM211 - Computer Architecture 1
The Hexadecimal Numbering System
Problem with the binary system is verbosity.

◦ To represent the value 202 (decimal) requires eight binary


digits.

◦ The decimal version requires only three decimal digits and


thus represents numbers much more compactly than does
the binary numbering system.

◦ When dealing with large values binary numbers which


could be unwieldy hence it is better to use Hexadecimal
(Hex).

COM211 - Computer Architecture 1


The Hexadecimal Numbering System

Theadvantages of using Hexadecimal


numbers are:
◦ They're very compact and
◦ It's simple to convert them to binary and vice
versa.
For example the number 1234 (hexadecimal) is
equal to:
◦ 1 x 163 + 2 x 162 + 3 x 161 + 4x160
or
◦ 4096 + 512 + 48 + 4 = 4660 (decimal).
COM211 - Computer Architecture 1
The Hexadecimal Numbering System
 Each hexadecimal digit can represent one of sixteen
values between 0 and 15.

 The letters A through F are used to represent the


numbers from 10 to 15.

 The following are all examples of valid


hexadecimal numbers:
1234 DEAD BEEF 0AFB FEED DEAF

COM211 - Computer Architecture 1


The Hexadecimal Numbering System
 To differentiate hexadecimal numbers from decimal
numbers we’ll adopt the following conventions:

◦ All numeric values (regardless of their radix) begin


with a decimal digit.

◦ All hexadecimal values end with the letter "h" e.g.


123A4h.

◦ All binary values end with the letter "b".

◦ Decimal numbers may have a "t" or "d" suffix.


COM211 - Computer Architecture 1
The Hexadecimal Numbering System

Examplesof valid hexadecimal numbers:


1234h 0DEADh 0BEEFh 0AFBh 0FEEDh
0DEAFh

Examples of valid binary numbers:


◦ a) 1011b b) 1001b c) 1001 1100b

Examples of valid decimal numbers:


◦ a) 1011t b) 121d c) 123
COM211 - Computer Architecture 1
The Hexadecimal Numbering System

Binary/Hex Conversion
Binary Hexadecimal
0000 0
0001 1
0010 2
0011 3
0100 4
0101 5
0110 6
0111 7
1000 8
1001 9
1010 A
1011 B
1100 C
1101 D
1110 E
1111 F

COM211 - Computer Architecture 1


Conversion from Hexadecimal to Binary
 To convert a hexadecimal number into a
binary number simply substitute the
corresponding four bits for each hexadecimal
digit in the number.

◦ For example to convert 0ABCDh into a binary


value simply convert each hexadecimal digit
according to the table above:

◦ 0 A B C D Hexadecimal
◦ 0000 1010 1011 1100 1101 Binary
COM211 - Computer Architecture 1
Converting Binary to Hexadecimal Numbers

 Convert a binary number into hexadecimal as


follows:

◦ First step is to pad the binary number with zeros to obtain a


multiple of four bits in the number.

◦ Step 2 is to separate the binary value into groups of four


bits.

◦ Step 3 is to convert each group of four bits into the


Hexadecimal value

COM211 - Computer Architecture 1


Converting Binary to Hexadecimal Numbers

Example:
Convert 1011001010 (base 2) to
Hexadecimal:

◦ Solution:
◦ Step 1: Add two bits to the left of the binary
number 1011001010 so that it contains 12 bits.

◦ The binary number becomes: 001011001010.

COM211 - Computer Architecture 1


The Hexadecimal Numbering System

Step 2:
◦ Separate the binary value into groups of four bits
giving: 0010 1100 1010.

 Step 3:
◦ Convert each group to the appropriate hexadecimal
digits which gives: 2CA.

COM211 - Computer Architecture 1


Arithmetic Operations
on
Binary and Hexadecimal Numbers

NEXT

LESSON 2B

COM211 - Computer Architecture 1


BINARY TO DECIMAL CONVERSION

EXAMPLE:
Convert 1000 110112 to Decimal number

The Multiply and Add Algorithm:


◦ 1. Start with the Msb, multiply by 2 and add the
next bit
◦ 2. Multiply the result obtained by 2 and add the
next bit
◦ 3. Continue process until you’ve added the Lsb and
stop

COM211 - Computer Architecture 1


BINARY TO DECIMAL CONVERSION

EXAMPLE:

 Convert 1000 110112 to Decimal number


Solution:
 1 0 0 0 1 1 0 1 1 283
ADD
x2

2 4 8 16 34 70 140 282

x2
ADD
Therefore 1000110112 = 28310
COM211 - Computer Architecture 1
BINARY TO DECIMAL CONVERSION

EXAMPLE:
Convert the binary fraction 0.11010001 2 to
Decimal number

The Divide and Add Algorithm:


◦ 1. Start with the rightmost bit, divide by 2 and add
the next bit to the left
◦ 2. Divide the result obtained by 2 and add the next
bit to the left
◦ 3. Continue process until you’ve added the bit
immediately after decimal point(.) and stop
COM211 - Computer Architecture 1
BINARY TO DECIMAL CONVERSION
EXAMPLE:
Convert binary fraction 0.11010001 2 to
Decimal number
Solution:
 0. 1 1 0 1 0 0 0 1
ADD /2

0.81640625 0.6328125 0.265625 0.53125 0.0625 0.125 0.25 0.50

ADD /2
Therefore 0.110100012 = 0.8164062510
COM211 - Computer Architecture 1
DECIMAL TO BINARY CONVERSION
The Divide and Remainder Algorithm for
the Integer part:
◦ 1. Divide number by 2 and record remainder

◦ 2. Divide the resultant quotient by 2 and record


remainder

◦ 3. Continue until final remainder of 0 is obtained

◦ 4. The first remainder written is the lsb and the one


written last is the Msb
COM211 - Computer Architecture 1
DECIMAL TO BINARY CONVERSION
EXAMPLE:
 Convert 21710 to binary
Solution:
 2 217
2 108 R 1
2 54 R 0
2 55 R 0
2 56 R 1
2 57R 1
2 58R 0
2 59R 1
2 0 R 1
Therefore, 21710 = 110110012
COM211 - Computer Architecture 1
DECIMAL TO BINARY CONVERSION
Multiply and Carry Algorithm for the
decimal part:
◦ 1. Multiply the Decimal part by 2 and record the
carry over (Overflow)
◦ 2. Multiply the resultant number by 2 and record
Carry over (Overflow)
◦ 3. Continue until the desired level of decimal
places is reached
◦ 4. The first Carry Over recorded is the Msb ( ie the
bit immediately to the right of the decimal point)

COM211 - Computer Architecture 1


DECIMAL TO BINARY CONVERSION
EXAMPLE:
 Convert 0.7812510 to binary
Solution:
Carry Overs
0.78125
0.78125 x 2 = 1.5625 1
0.5625 x 2 = 1.135 1
0.135 x 2 = 0.27 0
0.27 x2 = 0.54 0
0.54 x2 = 1.08 1
0.08 x2 = 0.16 0
0.16 x 2 = 0.32 0

Thus 0.7812510 = (0.1100100.....)


COM211 - Computer Architecture 1
2
DECIMAL TO BINARY CONVERSION
EXAMPLE:
 Convert 0.8510 to binary
Solution:
Carry Overs
0.85
0.85 x 2 = 1.70 1
0.7 x 2 = 1.4 1
0.4 x 2 = 0.8 0
0.8 x 2 = 1.6 1
0.6 x 2 = 1.2 1
0.2 x 2 = 0.4 0
0.4 x 2 = 0.8 0

Thus 0.8510 = (0.1101100..)COM211


2
- Computer Architecture 1
CONVERSION OF MIXED
NUMBERS
EXAMPLE 1:
 Convert 10011.1012 to a Decimal number
Solution:
1 0 0 1 1 . 1 0 1
19

0.625 0.25 0.5


2 4 8 18

Thus 10011.1012 = 19.625COM211


10
- Computer Architecture 1
CONVERSION OF MIXED
NUMBERS
EXAMPLE 2:
 Convert 33.310 to binary
Solution:
Carry Overs
2 33 . 3
2 16 R 1 0.3 x2 = 0 .6 0
2 8 R0 0.6 x2 = 1 .2 1
2 4 R0 0.2 x2 = 0 .4 0
2 2 R0 0.4 x2 = 0 .8 0
2 1 R 0 0.8 x2 = 1 .6 1
2 0 R1 0.6 x2 = 1 .2 1
0.2 x2 = 0 .4 0

Thus 33.310 = (10001.0100110..)


COM211 - Computer Architecture 1
2
CONVERSION OF MIXED
NUMBERS
EXAMPLE 2:
 Convert 33.310 to binary
Solution:
Carry Overs
2 33 . 3
2 16 R 1 .3 x2
2 8 R0 0 .6 x2
2 4 R0 1 .2 x2
2 2 R0 0 .4 x2
2 1 R 0 0 .8 x2
2 0 R1 1 .6 x2
1 .2 x2

Thus 33.310 = (10001.0100110..)


COM211 - Computer Architecture 1
2
ADDITION AND SUBTRACTION OF BINARY
NUMBERS
EXAMPLE:
Add the binary numbers A= 11101100 and
B = 1100110
Solution:
 Column 9 8 7 6 5 4 3 2 1 (Decimal Addition)
A 11101100 (236)
B 1100110 (102)
______________
101010010 (338)

COM211 - Computer Architecture 1


SUBTRACTION OF BINARY NUMBERS
Rules:
1. 1–1=0
2. 0–0=0
3. 1–0=1
4. 0 – 1 = 1 with a borrow out

In order to borrow, change the next 1 in the minuend to a 0


and change all intervening 0s to 1s

Note:

COM211 - Computer Architecture 1


SUBTRACTION OF BINARY NUMBERS
Example:
Subtract 101101001 from 100011010011
Column 12 11 10 9 8 7 6 5 4 3 2 1 (Decimal Subtraction)
1 0 0 011010011 (2259)
101101001 - (361)
_____________________
1 1 101101010 (1898)

Note:

COM211 - Computer Architecture 1


SUBTRACTION OF BINARY NUMBERS

LESSON 2C
Subtractions
[Lesson 2 continues]

COM211 - Computer Architecture 1


COMPLEMENTS OF NUMBERS
r's Complement:

 For a Number N having n digits in base "r":

 r's Complement = rn – N

 Converts (r-1)'s complement to r's complement by


adding 1.

 10's complement in Decimal Number System,

 2's complement in Binary Number System.


Page 55
COM211 - Computer Architecture 1
COMPLEMENTS OF NUMBERS

r's Complement:

Example 1:
10's complement of 830594 = 169406

 Example 2:
2's complement of 10110010110101 is
01001101001011

Page 56
COM211 - Computer Architecture 1
Substraction of Unsigned Numbers:

 M - N (in base r)

 M is minuend, N is subtrahend

To perform subtraction:

 Add M to r's complement of N.

M – N = M + (rn - N) = M - N + rn

Page 57
November 22, 2 COM211 - Computer Architecture 1
Substraction of Unsigned Numbers:

 If M >= N, then the sum will produce an end carry


rn which is discarded.

 If M < N, then the sum does not produce an end


carry. Then, Answer is negative and equal to rn - (N
- M), which is r's complement of (N - M).

 To obtain the answer in a familiar form, take r's


complement of the sum and place a negative sign
in front.

Page 58
November 22, 2 COM211 - Computer Architecture 1
Binary Substraction using 2's complement:
 Example:
110100010101 – 10110001

 First, increase length of subtrahend to the length


of minuend: 000010110001

 2's complement of 000010110001


= 111101001111

 110100010101
+ 111101001111
= 1 110001100100 Discard carry:
Ans = 110001100100
November 22, 2 Page 59
023 COM211 - Computer Architecture 1
DATA REPRESENTATION
SIGNED NUMBERS

 When an integer number is positive, the sign is


represented by 0 and the magnitude by a positive
binary number.

 When the number is negative, the sign is


represented by 1 but the number may be
represented in one of three possible ways:

 Signed-magnitude representation,
 Signed-1's complement representation,
 Signed-2's complement representation,
November 22, 2 Page 60
COM211 - Computer Architecture 1
023
SIGNED NUMBERS
The left-most bit is always used as the sign bit in
signed numbers.
 If a signed number is stored in 16-bit
register, the register holds 15 significant bits,
plus a sign bit.
 A 16-bit register can hold signed numbers
between the ranges -215 and +(215 - 1)

 Example: 8-bit signed numbers:


0 = 00000000, 1 = 00000001,
127 = 01111111, -1 = 11111111,
-2 = 11111110, -128 = 10000000.
November 22, 2 Page 61
COM211 - Computer Architecture 1
023
Signed Integers
Three representation schemes are available for
signed integers:

◦ Sign-Magnitude representation
◦ 1's Complement representation
◦ 2's Complement representation

In the three schemes, the most-significant bit (msb)


is called the sign bit.
◦ with 0 for positive integers and 1 for negative integers.

◦ The magnitude of the integer, however, is interpreted


differently in different schemes. COM211 - Computer Architecture 1
Sign-magnitude representation

 In sign-magnitude representation:

The most-significant bit (msb) is the sign bit,


with value of 0 representing positive integer
and 1 representing negative integer.

Theremaining (n-1) bits represents the


magnitude (absolute value) of the integer.

COM211 - Computer Architecture 1


Sign-magnitude representation

Example 1: Suppose that n=8 and the binary


representation is 0 100 0001B.
◦ Sign bit is 0 ⇒ positive
◦ Absolute value is 100 0001B = 65 (decimal)
◦ Hence, the integer is +65 (decimal)

Example 2: Suppose that n=8 and the binary


representation is 1 000 0001B.
◦ Sign bit is 1 ⇒ negative
◦ Absolute value is 000 0001B = 1 (decimal)
◦ Hence, the integer is -1 (decimal)
COM211 - Computer Architecture 1
Sign-magnitude representation

Example 3: Suppose that n=8 and the binary


representation is 0 000 0000B.
◦ Sign bit is 0 ⇒ positive
◦ Absolute value is 000 0000B = 0 (decimal)
◦ Hence, the integer is +0 (decimal)

Example 4: Suppose that n=8 and the binary


representation is 1 000 0000B.
◦ Sign bit is 1 ⇒ negative
◦ Absolute value is 000 0000B = 0 (decimal)
◦ Hence, the integer is -0 (decimal)
COM211 - Computer Architecture 1
Sign-magnitude representation

The drawbacks of sign-magnitude


representation are:

◦ There are two representations for the number zero


(0000 0000B and 1000 0000B), which could lead
to inefficiency and confusion.

◦ Positive and negative integers need to be processed


separately.

COM211 - Computer Architecture 1


1’s Complement representation
n-bit
Sign Integers in 1's Complement
Representation
◦ In 1's complement representation:

◦ Again, msb is the sign bit, with value of 0 for positive


integers and 1 for negative integers.

◦ Remaining n-1 bits represents the magnitude as follows:

◦ for negative integers, the absolute value of the integer is


equal to "the magnitude of the complement (inverse) of the
(n-1)-bit binary pattern" (called 1's complement).

COM211 - Computer Architecture 1


1’s Complement representation
Example 1: Suppose that n=8 and the binary
representation 0 100 0001B.
◦ Sign bit is 0 ⇒ positive
◦ Absolute value is 100 0001B = 65 (decimal)
◦ Hence, the integer is +65 (decimal)

Example 2: Suppose that n=8 and the binary


representation 1 000 0001B.
◦ Sign bit is 1 ⇒ negative
◦ Absolute value is the 1’s complement of 000 0001B,
i.e., 111 1110B = 126 (decimal)
◦ Hence, the integer is -126 (decimal)
COM211 - Computer Architecture 1
1’s Complement representation
Example 3: Suppose that n=8 and the binary
representation 0 000 0000B.
◦ Sign bit is 0 ⇒ positive
◦ Absolute value is 000 0000B = 0 (Decimal)
◦ Hence, the integer is +0 (Decimal)

Example 4: Suppose that n=8 and the binary


representation 1 111 1111B.
◦ Sign bit is 1 ⇒ negative
◦ Absolute value is the complement of 111 1111B,
◦ i.e., 000 0000B = 0 (Decimal)
◦ Hence, the integer is -0 (Decimal)
COM211 - Computer Architecture 1
1’s Complement representation

Again, the drawbacks are:

Thereare two representations:


(0000 0000B and 1111 1111B) for zero.

The positive integers and negative integers


need to be processed separately.

COM211 - Computer Architecture 1


2’s Complement representation

n-bitSign Integers in 2's Complement


Representation
◦ In 2's complement representation:

◦ The msb is the sign bit, with value of 0 for positive integers
and 1 for negative integers.

◦ The remaining n-1 bits represents the magnitude of the


integer, except that:

◦ For negative integers, the absolute value of the integer is


equal to "the magnitude of the 2’s complement of the (n-1)
bit binary pattern " (called 2's complement).
COM211 - Computer Architecture 1
2’s Complement representation

Example 1: Suppose that n=8 and the binary


representation 0 100 0001B.
◦ Sign bit is 0 ⇒ positive
◦ Absolute value is 100 0001B = 65(decimal)
◦ Hence, the integer is +65 (decimal)

Example 2: Suppose that n=8 and the binary


representation 1 000 0001B.
◦ Sign bit is 1 ⇒ negative
◦ Absolute value is the complement of 000 0001B plus 1,
i.e., 111 1110B + 1B = 127 (decimal)
◦ Hence, the integer is -127 (decimal)
COM211 - Computer Architecture 1
2’s Complement representation

Example 3: Suppose that n=8 and the binary


representation 0 000 0000B.
◦ Sign bit is 0 ⇒ positive
◦ Absolute value is 000 0000B = 0 (decimal)
◦ Hence, the integer is +0 (decimal)

Example 4: Suppose that n=8 and the binary


representation 1 111 1111B.
◦ Sign bit is 1 ⇒ negative
◦ Absolute value is the complement of 111 1111B plus 1,
i.e., 000 0000B + 1B = 1 (decimal)
◦ Hence, the integer is -1 (decimal)
COM211 - Computer Architecture 1
2’s Complement representation

Computers use 2's Complement Representation


for Signed Integers because:

There is only one representation for the number zero


in 2's complement, instead of two representations in
sign-magnitude and 1's complement.

Positive and negative integers can be treated together


in addition and subtraction. Subtraction can be
carried out using the "addition logic".

COM211 - Computer Architecture 1


2’s Complement Addition

Example 1:
Addition of Two Positive Integers:
Suppose that n = 8 bits,
◦ 65d + 5d = 70 (decimal)

◦ 65d → 0100 0001B


+
◦ 5d → 0000 0101B
◦ (0) 0100 0110B → 70 (decimal) (OK)


COM211 - Computer Architecture 1
2’s Complement Addition
Example 2: Subtraction is treated as Addition of a
Positive and a Negative Integers:

Suppose that n = 8 bits,

 65d – 5d = 65d + (-5d) = 60 (decimal)

◦ 65D → 0100 0001B


+
◦ -5D → 1111 1011B
(1) 0011 1100B → 60decimal (discard carry - OK)

COM211 - Computer Architecture 1


2’s Complement Addition

Example 3: Addition of two Negative


Integers: Suppose that n = 8,

◦ -65d – 5d = (-65d) + (-5d) = -70d

◦ -65d → 1011 1111B


+
◦ -5d → 1111 1011B
(1) 1011 1010B → -70 (decimal)
◦ (discard carry - OK)
COM211 - Computer Architecture 1
2’s Complement Overflow
 When working with 8-bits unsigned numbers Carry
bit from the 8 bits indicate that the number is too big.

 With signed numbers, the Carry bit is simply


ignored.

Hence another rule is needed to detect when result is


out of range

The rule for detecting 2’s complement overflow is


“When Carry into MSB does not equal the Carry
Out from MSB
COM211 - Computer Architecture 1
2’s Complement Overflow
 Examples:

◦ 1] 15 + (-15)
◦ 15 = 0000 1111
◦ +15 = 0000 1111
◦ 30 = 0001 1110 OK

◦ 2] 127 + 1
◦ 127 = 0111 1111
◦ + 1= 0000 0001
◦ - 128 = (0) 1000 0000 (0) 1 Overflow

COM211 - Computer Architecture 1


2’s Complement Overflow
 Examples:

◦ 3] -15 + (-15)
◦ -15 = 1111 0001
◦ + -15 = 1111 0001
◦ - 30 = (1) 1110 0010 (1) 1 OK

◦ 4] -127 + (- 2)
◦ -127 = 1000 0001
◦ + -2 = 1111 1110
◦ - 129 = (1) 0111 1111 (1) 0 Overflow

COM211 - Computer Architecture 1


2’s Complement representation
Because of the fixed precision (i.e., fixed number of
bits), an n-bit 2's complement signed integer has a
certain range.

Forexample, for n= 4 bits, the range of 2's


complement signed integers is - 8 to +7.

Notice the asymmetry

During addition (and subtraction), it is important to


check whether the result exceeds this range, in other
words, whether overflow or underflow has occurred.
COM211 - Computer Architecture 1
2’s Complement representation

COM211 - Computer Architecture 1


2’s Complement representation

COM211 - Computer Architecture 1


Range of n-bit numbers

For unsigned binary numbers, the range is:


From 0 to (2n - 1).

 Example:

 With 4 bits, the range is From 0 to (24 – 1)

From 0 to 15

COM211 - Computer Architecture 1


Range of n-bit numbers

For Sign + Magnitude binary numbers, the range is:


From – (2n-1 + 1) to (2n-1 - 1).

 Example:

 With 4 bits, the range is from –(23 +1) to (23 – 1)

From -7 to 7

COM211 - Computer Architecture 1


Range of n-bit numbers

For 2’s Complement binary numbers, the range is:


From – (2n-1 ) to (2n-1 - 1).

 Example:
 With 4 bits, the range is from –(23 ) to (23 – 1)

From -8 to 7

By implication, If n = 8 bits, the range of 2's


complement signed integers is -128 to +127.

COM211 - Computer Architecture 1


2’s Complement
The One byte 2’s Complement representation
for signed integers uses the following column
headings

-128 64 32 16 8 4 2 1

COM211 - Computer Architecture 1


2’s Complement
 Examples
 +18 -128 64 32 16 8 4 2 1

0 0 0 1 0 0 1 0

 -18
-128 64 32 16 8 4 2 1

1 1 1 0 1 1 1 0

COM211 - Computer Architecture 1


2’s Complement

 Note:
 The range of integers that can be
represented with one byte is from -128 to
+127

-128 64 32 16 8 4 2 1
1 0 0 0 0 0 0 0 = -128
0 1 1 1 1 1 1 1 = +127

COM211 - Computer Architecture 1


2’s Complement
 An easy trick for converting negative decimal
numbers to 2’s Complement is as follows:

 Step 1: Convert the number to the positive unsigned


binary

Step 2 : Starting from the right hand side, copy each


bit, up to and including the first “1”:

Step3: Reverse all the other bits:

COM211 - Computer Architecture 1


2’s Complement
 Example:
Convert (-52) denary into the 2’s Complement
binary representation:
 Step 1: Convert the number to the positive unsigned
binary -128 64 32 16 8 4 2 1
0 0 1 1 0 1 0 0
Step 2 : Starting from the right hand side, copy each
bit, up to and including the first “1”:
-128 64 32 16 8 4 2
01 0 1 1 0 1 0 0
1 0 0
Step3: Reverse all the other bits:
0 0 1 1 0 1 0 0
1 1 0 0 1 1 0 0 = -52
COM211 - Computer Architecture 1
Converting Negative binary numbers
into Denary
 Example 1:
Convert the “signed” 2’s Complement binary
number 11010101 to base 10:
Step 1: -128 64 32 16 8 4 2 1
1 1 0 1 0 1 0 1

Step 2: = -128 + 64 + 16 + 4 + 1
= -43
Example 2: Convert the sign + magnitude number
11001100 to Denary:
- 64 32 16 8 4 2 1
1 1 0 0 1 1 0 0

= - (64 + 8 + 4) = -76 COM211 - Computer Architecture 1


Signed and Unsigned Numbers
The following examples provide some positive and
negative 16-bit signed 2’s complement values:

◦ 7FFFh: +32767 (the largest 16-bit positive number).

◦ 8000h: -32768 (the smallest 16-bit negative number.

◦ 4000h: = +16384.

To convert the numbers above to their negative


counterpart (i.e. to negate them) do the following:

COM211 - Computer Architecture 1


Signed and Unsigned Numbers
7FFFh = 0111 1111 1111 1111
= +32767 (the largest 16-bit positive number).

2’sComplement = 1000 0000 0000 0000


= 8000h
= -32768 (the smallest 16-bit negative
number.

COM211 - Computer Architecture 1


Signed and Unsigned Numbers
To convert the numbers above to their
negative counterpart (i.e. to negate them) do
the following:
◦ 7Fh: 0111 1111
( = + 127t)

Perform 2’s Complement:


1000 0001 (81h or - 127t)

COM211 - Computer Architecture 1


Signed and Unsigned Numbers
80h: 1000 0000 = -127t
◦ 2’s complement of 80h gives
1000 0000 ( = 80h or -127t)
Wait what's going on here? -(- 127) is

- 127? Of course not.

The issue is that the value + 128 cannot be


represented with a 8-bits signed number so we
cannot negate the smallest negative value.

40h: 0100 0000 = + 64t


2’s complement of 40h gives

1100 0000 (0C0h = - COM211


64t)- Computer Architecture 1
Signed and Unsigned Numbers
 WORKED EXAMPLES

COM211 - Computer Architecture 1


Signed and Unsigned Numbers
For example suppose you were to perform the
addition 5+(-5).

The result is zero.

Consider what happens when we add these


two values in the two's complement system:
◦ 00000101
11111011
◦ 1) 00000000
COM211 - Computer Architecture 1
Signed and Unsigned Numbers
We end up with a carry into the ninth bit and all
other bits are zero.

 As it turns out if we ignore the carry out of the H.O.


bit adding two signed values always produces the
correct result when using the two's complement
numbering system.

This means we can use the same hardware for signed


and unsigned addition and subtraction.

Thiswouldn't be the case with some other


numbering systems. COM211 - Computer Architecture 1
Sign and Zero Extensions

NEXT

Sign and Zero Extensions

COM211 - Computer Architecture 1


Sign and Zero Extension
Since two's complement format integers have a fixed
length a small problem develops.

What happens if you need to convert an eight bit


two's complement value to 16 bits?

This problem and its converse (converting a 16 bit


value to eight bits) can be accomplished via sign
extension and contraction operations.

Zero extension lets you convert small unsigned


values to larger unsigned values.
COM211 - Computer Architecture 1
Sign and Zero Extension
Zero extension lets you convert small
unsigned values to larger unsigned values.

Consider the value "-64".

Theeight bit two's complement value for this


number is 0C0h.

 The 16-bit equivalent of this number is


0FFC0h.
COM211 - Computer Architecture 1
Sign and Zero Extension
Now consider the value "+64".
 The eight and 16 bit versions of this value are 40h
and 0040h.

 The difference between the eight and 16 bit numbers


can be described by the rule:

"If
the number is negative the H.O. byte of the 16 bit
number contains 0FFh;

 if the number is positive the H.O. byte of the 16 bit


quantity is zero." COM211 - Computer Architecture 1
Sign and Zero Extension
To sign extend a value from some number of bits to a
greater number of bits is easy just copy the sign bit
into all the additional bits in the new format.

For example to sign extend an eight bit number to a


16 bit number simply copy bit seven of the eight bit
number into bits 8..15 of the 16 bit number.

To sign extend a 16 bit number to a double word


simply copy bit 15 into bits 16..31 of the double
word.

COM211 - Computer Architecture 1


Sign and Zero Extension
 Sign extension is required when manipulating
signed values of varying lengths.

 Often you'll need to add a byte quantity to a word


quantity.

You must sign extend the byte quantity to a word


before the operation takes place.

Other operations (multiplication and division in


particular) may require a sign extension to 32-bits.
 You must not sign extend unsigned values
COM211 - Computer Architecture 1
Sign and Zero Extension
 Examples of sign extension:


Eight Bits Sixteen Bits Thirty-two Bits

1 80h FF80h FFFF FF80h

2 28h 0028h 0000 0028h

3 9Ah FF9Ah FFFF FF9Ah

4 7Fh 007Fh 0000 007Fh

5 --- 1020h 0000 1020h

6 --- 8088h FFFF 8088h

COM211 - Computer Architecture 1


Sign and Zero Extension
To extend an unsigned byte you must zero
extend the value.

◦ Zero extension is very easy - just store a zero into


the H.O. byte(s) of the smaller operand.

◦ For example to zero extend the value 82h to 16-


bits you simply add a zero to the H.O. byte
yielding 0082h.

COM211 - Computer Architecture 1


Sign and Zero Extension
 Eight Bits Sixteen Bits Thirty-two Bits

 80h 0080h 00000080h
 28h 0028h 00000028h
 9Ah 009Ah 0000009Ah
 7Fh 007Fh 0000007Fh
 --- 1020h 00001020h
 --- 8088h 00008088h

COM211 - Computer Architecture 1


Sign Contraction
Sign contraction converting a value with some
number of bits to the identical value with a fewer
number of bits is a little more troublesome.

 Sign extension never fails.

Given an m-bit signed value you can always convert


it to an n-bit number (where n > m) using sign
extension.

Unfortunately given an n-bit number you cannot


always convert it to an m-bit number if m < n.
COM211 - Computer Architecture 1
Sign and Zero Extension
 Unfortunately given an n-bit number you cannot always
convert it to an m-bit number if m < n.

 For example consider the value - 448.

 As a 16-bit hexadecimal number its representation is


0FE40h.

 Unfortunately the magnitude of this number is too great to


fit into an eight bit value so you cannot sign contract it to
eight bits.

 This is an example of an overflow condition that occurs upon


conversion.
COM211 - Computer Architecture 1
Sign and Zero Extension
To properly sign contract one value to another you
must look at the H.O. byte(s) that you want to
discard.

 The H.O. bytes you wish to remove must all


contain either zero or 0FFh.

Ifyou encounter any other values you cannot


contract it without overflow.

Finally the H.O. bit of your resulting value must


match every bit you've removed from the number.
COM211 - Computer Architecture 1
Sign and Zero Extension
Examples (16 bits to eight bits):

FF80h can be sign contracted to 80h

0040h can be sign contracted to 40h

FE40h cannot be sign contracted to 8 bits.

0100h cannot be sign contracted to 8 bits.


COM211 - Computer Architecture 1
QUICK REVISION


CONTINUE WITH SLIDE ON FLOATI
NG POINTS

COM211 - Computer Architecture 1


ASSIGNMENT
1. Find the representation of -2 as a 4 – bit
two’s complement number
 2. Find the decimal value of the two’s
complement number 10012
 3. Compute using two’s complement:
 a) -2 + 1
 b) -7 + 7
 c) 5 – 3
 d) 3 – 5
 e) 4 + 5 COM211 - Computer Architecture 1
ASSIGNMENT
 4. Assuming a single byte is used, convert
the following numbers into two’s complement
binary:
a) -5
b) -10
c) - 20

 5. What is the denary value od 10101011 if


the binary code represent:
a) a two’s complement number
b) a Sign and Magnitude number
COM211 - Computer Architecture 1
ASSIGNMENT 6 : Complete the following table of
Negative Binary Numbers

Decimal Binary Signed I’s Complement 2’s Excess
Magnitude Complement 127

1 00000001 10000001 11111110 11111111 01111110


3 00000010
7 00000111
20
30
50
70 01000110 00111001
120
127 01111111 11111111 10000000 10000001 00000000
128 None None Existent None Existent 10000000 None
Existent Existent

COM211 - Computer Architecture 1


SELF PRACTICE EXERCISE
 Exercise (Integer Representation)
1). What are the ranges of 8-bit, 16-bit, 32-bit and
64-bit integer, in "unsigned" and "signed"
representation?
2). Give the value of 88, 0, 1, 127, and 255 in 8-bit
unsigned representation.
3). Give the value of +88, -88 , -1, 0, +1, -128, and
+127 in 8-bit 2's complement signed representation.
4). Give the value of +88, -88 , -1, 0, +1, -127, and
+127 in 8-bit sign-magnitude representation.
5). Give the value of +88, -88 , -1, 0, +1, -127 and
+127 in 8-bit 1's complement representation.
COM211 - Computer Architecture 1
Answers to self practice exercise

COM211 - Computer Architecture 1


Answers to self practice exercise
2). Using Unsigned number representation
◦ 88 (0101 1000),

◦ 0 (0000 0000),

◦ 1 (0000 0001),

◦ 127 (0111 1111),

◦ 255 (1111 1111).

COM211 - Computer Architecture 1


Answers to self practice exercise
 3). Using 2’s Complement
◦ +88 (0101 1000),

◦ -88 (1010 1000),

◦ -1 (1111 1111),

◦ 0 (0000 0000),

◦ +1 (0000 0001),

◦ -128 (1000 0000),

◦ +127 (0111 1111). COM211 - Computer Architecture 1


Answers to self practice exercise
4.) Using Sign plus magnitude
◦ +88 (0101 1000),

◦ -88 (1101 1000),

◦ -1 (1000 0001),

◦ 0 (0000 0000 or 1000 0000),

◦ +1 (0000 0001),

◦ -127 (1111 1111),

◦ +127 (0111 1111).

COM211 - Computer Architecture 1


Answers to self practice exercise
 5). Using 1’s complement
◦ +88 (0101 1000),

◦ -88 (1010 0111),

◦ -1 (1111 1110),

◦ 0 (0000 0000 or 1111 1111),

◦ +1 (0000 0001),

◦ -127 (1000 0000),

◦ +127 (0111 1111).. COM211 - Computer Architecture 1


END OF LESSON

THANK YOU

COM211 - Computer Architecture 1


LESSON 1B
FLOATING POINT ARITHMETIC
FLOATING POINT ARITHMETIC
In computers, floating-point numbers are represented
in scientific notation of fraction (F) and exponent (E)
with a radix of 2, in the form:
N = F x 2E
= 1.m x 2e.

Both E and F can be positive as well as negative.

Modern computers adopt IEEE 754 standard for


representing floating-point numbers.

There are two representation schemes: 32-bit single-


precision and 64-bit double-precision.
LESSON 4
FLOATING POINT ARITHMETIC
In computers, floating-point numbers are represented
in scientific notation of fraction (F) and exponent (E)
with a radix of 2, in the form:
N = 1.m x 2e.

Here the fraction part is


F = 1.m

While the stored exponent uses Excess 127 so


E = e + 127.
IEEE-754 32-bit Single-Precision Floating-
Point Numbers
In 32-bit single-precision floating-point
representation:

The most significant bit is the sign bit (S), with 0 for
negative numbers and 1 for positive numbers.

The following 8 bits represent exponent (E).

The remaining 23 bits represents fraction (F)


Normalized Form
Example, suppose we have the following 32-
bit pattern:
1 1000 0001 011 0000 0000 0000 0000 0000,

Then:
S = 1
E = 1000 0001
m = 011 0000 0000 0000 0000 0000
In the normalized form, the actual fraction is
normalized with an implicit leading 1 in the
form of F = 1.m.
Normalized Form
Example, suppose that the 32-bit pattern is 1
1000 0001 011 0000 0000 0000 0000 0000,
m = mantissa
Then: F = 1.m
In this example, the actual fraction is
F = 1.011 0000 0000 0000 0000 0000
= 1 + 1×2-2 + 1×2-3
= 1.375d.

Since sign bit S=1, this is a negative number,


i.e., -1.375d.
Normalized Form
In normalized form, the actual exponent is
e = E-127 (so-called excess-127 or bias-127).
 This is because we need to represent both positive
and negative exponents.

With an 8-bit E, ranging from 0 to 255, the excess-


127 scheme could provide actual exponent of -127 to
128.

In this example, e = E-127 = 129-127 = 2d.

Hence, the number represented is:


-1.375×22 = -5.5d.
Note: Better presentation
Example 1, suppose that the 32-bit pattern is
 1 1000 0001 011 0000 0000 0000 0000 0000,
Then:
S =1
E = 1000 0001 = 129d
m = 011 0000 0000 0000 0000 0000
 The actual fraction in normalized form is
 F = 1.m = 1.011 0000 000 0000 0000.
In this example, e = E-127 = 129-127 = 2d.
Hence, the number represented is:

- 1.0110 x 22 = 101.10 = -5.5d.


Note: Better presentation
Example 2, Convert -5.7510 to a single
precision floating point representation
 Answer:
-5.75 = -101.112

= - 1.01112 x 22
S=1 e=2
Therefore E = 2 + 127 = 129 = 1000 0001 2
m = 011 1000 0000 0000 0000 0000
Hence, the number represented is:
N = 1 1000 0001 0111 0000 0000 0000 0000 000
S E m
Note: Better presentation
EXAMPLE 3:
 What is the Single Precision (32 bits)
floating point representation for 19.625 in
hexadecimal

Solution:

19.62510 = 10011.1012

See next slide


Note: EXAMPLE 3:
Solution:
First convert 19.625 to binary
19 . 625

2 19 Carry Overs
2 9 R1 .625 x 2
2 4 R1 1 .250 x 2
2 2 R0 0 .500 x 2
2 1 R0 1 .00 x 2
2 0 R1

Thus 19.625 = (10011.101 ..)2


Note: EXAMPLE 3:
Solution:
 Thus 19.625 = 10011.1012
 = 1.0011 101 x 24
S = 0 (Positive)
e = 4 Therefore E = 127 + 4 = 131 = 1000 0011
 m = 001 1101 0000 0000 0000 0000

Hence, the number represented is:


N = 0 1000 0011 0011 1010 0000 0000 0000 000
S E m
= 4 1 9 D 0 0 0 0h
Note: EXAMPLE 4:
 Express 5.7510 in 32 bit floating point representation
First convert 5.75 to binary
 Solution:
2 5 . 75 x 2
 Thus 5.75 = 101.11
2
2
2R1
1R0
1 50 x 2
1 00
2 0R1
 = 1.0111 x 22 5.75 = 101. 11 b
= 1 . 0111 x 2 2

 S = 0 (Positive)
e = 2 Therefore E = 127 + 2 = 129 = 1000 0001
 m = 0111 0000 0000 0000 0000 000

 Hence, the number represented is:


N = 0 1000 0001 0111 0000 0000 0000 0000 000
S E m
= 4 0 B 8 0 0 0 0h
Note: EXAMPLE 5:
 Express - 54.62510 in 32 bit floating point representation
 Solution:
First convert 54.625 to binary
 Thus - 54.625 = - 36.A16 16 54 . 625 x 16
16 3 R 6 A 000 x 16
 = - 0011 0110. 1010 16 0 R 3 0 000

54.624 = 36.A h
 = - 1.1 0110 1010 x 25 = 0011 0110 . 1010 b

S = 1 (Negative)
e = 5 Therefore E = 127 + 5 = 132 = 1000 0100
 m = 1011 0101 0000 0000 0000 0000

 Hence, the number represented is:


N = 1 1000 0100 1011 0101 0000 0000 0000 000
S E m
= C2 5 A80 0 0h
Note: EXAMPLE 6:
 Express 313.12510 in 32 bit floating point representation
 Solution:
 Thus 313.125 = 139.216 First convert 313.125 to binary

16 313 . 125 x 16
 = 0001 0011 1001. 0010 16 19 R 9
16 1 R 3
2
0
000 x 16
000
16 0 R 1

313.124 = 139.2 h

= 1.0011 1001 0010 x 28 = 0001 00011 1001 . 0010 b


S = 0 (Positive)
e = 8 Therefore E = 127 + 8 = 135 = 1000 0111
 m = 0011 1001 0010 0000 0000 0000

 Hence, the number represented is:


N = 0 1000 0111 0011 1001 0010 0000 0000 000
S E m
STOP HERE

STOP
THANK YOU

You might also like