0% found this document useful (0 votes)
7 views14 pages

Lesson 03 - Number Systems

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views14 pages

Lesson 03 - Number Systems

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

While the concept of number system

was present in the 'Abacus ' considered as


the first calculating machine of the world, it
has progressed up to the computer of
today.

Investigates how instructions and data


are represented in computers and exploit
them in arithmetic and logic operations

A/L ICT – Lesson 03


Competency 3: Investigates how instructions and data are represented in computers and exploit them in
arithmetic and logic operations.

Competency level 3.1: Analyses how numbers are represented in computers.

Number System

When typing letters or words using the computer, these words or letters are represented by the computer as
numbers it can understand. While this group of numbers that the computer can understand is called a
'Number System' the limited number of numerals in the number system called digits. The value of these
numbers (numerals) depends on the position they occupy within the number. While the concept of number
system was present in the 'Abacus ' considered as the first calculating machine of the world, it has progressed
up to the computer of today. The number system used for the representation of data in the computer is as
follows;

Number System Base Value Number and Alphabetic character used


Binary 2 0,1
Octal 8 0, 1, 2, 3, 4, 5, 6, 7
Decimal 10 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Hexa Decimal 16 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

Computer represents data in two signal states. There are two Voltage levels for these two symbols. One is
named as the high voltage level and the other is named as low voltage level. ''0'' and ''1'' digits respectively
represent these low and high voltage levels in a circuit. Thus, ''1'' and ''0'' status are equal to the “On” and
“Off” states of an electronic circuit. Any data in the world can be represented on the computer using these
two digits.
Most and Least Significant Positional Value of a Number.

There are two seperate methods to find the most and least significant values of decimal numbers and whole
numbers. When a whole number is read from left to right, the number in the right most end is the least
significant positional value and the number in the left most end which is not 0 is the most significant positional
value. In decimal numbers, the value in the right extreme after the decimal point which is not 0 becomes the
least significant positional value and the number in the left extreme of the decimal point which is not 0
becomes the most significant positional value.

Most Significant Digit (MSD) and Least Significant Digit (LSD)

Number MSD LSD


329 3 9
1237.0 1 7
58.32 5 2
0.0975 9 5
0.4 4 4
0401.0020 4 2

You can use the same method used for the decimal number system to find the most and least significant
positional digits of binary, octal and hexadecimal numbers.

Most Significant Bit (MSB) and Least Significant Bit (LSB)

Only the Binary Number System is used to find the most significant bit (MSB) and the least significant bit(LSB).
There are two ways to find this using decimal numbers and whole numbers. In a whole number, read from left
to right, the value in the right extreme is the least significant bit and the value in the left extreme which is not
0 is the most significant bit. In binary decimal numbers, the value in the right extreme of the decimal point
which is not 0 is the least significant bit and the value in the left extreme of the decimal point which is not 0 is
the most significant bit.
Conversions between number systems.

Decimal
Into
Binary

Binary
To
Decimal

Decimal
To Octal

Octal To
Decimal

Decimal
To Hexa
Decimal
Hexa
Decimal
To
Decimal

Octal To
Binary

Binary
To Octal

Hexa
decimal
To
Binary

Binary
To Hexa
Decimal
Octal To
Hexa
Decimal

Hexa
Decimal
To Octal

Sign-Magnitude

The sign and magnitude method is commonly an 8 bit system that uses the most significant bit (MSB) to
indicate a positive or a negative value. By convention, a ‘0’ in this position indicates that the number given by
the remaining 7 bits is positive, and a most significant bit of ‘1’ indicates that the number is negative. This
interpretation makes it possible to create a value of negative zero.
One’s Complement

In one's complement, positive numbers are represented as usual in regular binary. However, negative
numbers are represented differently. To negate a number, replace all zeros with ones, and ones with zeros -
flip the bits. Thus, 12 would be 00001100, and -12 would be 11110011. As in signed magnitude, the leftmost
bit (most significant bit-MSB) indicates the sign (1 is negative, 0 is positive). To compute the value of a
negative number, flip the bits and translate as before.

When representing positive and negative numbers in 8-bit ones complement binary form, the positive
numbers are the same as in signed binary notation.

 -120 is represented in one’s complement form as 100001112 and


 -60 is represented in one’s complement form as 110000112

The ones complement system still has two ways of writing 010 (000000002 = +010 and 111111112 = −010);

Two’s Complement.

A single set of bits is used. To form a negative number, start with a positive number, complement each bit and
add one. This interpretation includes one more negative value than positive values (to accommodate zero).
Addition using 2's complement

1. Show how the computation 15+(-5) is done in 8-bit two's complement arithmetic. Explain how you deal
with the carry generated in the most significant bit.

15 -> 000011112

5-> 000001012

-5-> 111110102+000000012 ->111110112

000011112(15)

+111110112(-5)

000010102

 Ignore the carry bit

2. Explain how the positive and negative numbers in two's complement can be converted into decimal
numbers.

Identify the sign of the final decimal number by MSB

If MSB is 0 - >positive

 Convert to decimal

If MSB is 1 ->negetive

 Take the sign as negetive


 Get binary number
 Invert bit values
 Add 1 to LSB
 Convert the number into decimal
Representation Usage
Method
Sign Used only when we do not add or subtract the data. They are used in analog to digital
Magnitude conversions. They have limited use as they require complicated arithmetic circuits.

One’s Simpler design in hardware due to simpler concept.


Complement

Two’s Makes it possible to build low-cost, high-speed hardware to perform arithmetic


Complement operations.

Fixed point numbers

In calculations involving fixed point numbers that have a fixed number of digits after the decimal point.

Floating point

The floating point number is used to represent

– Numbers with fractions, e.g., 3.1416


– Very small numbers, e.g., 0.000000001
– Very large numbers, e.g., 3.15576 × 109

There are several ways to represent floating point number but IEEE 754 is the most efficient in most cases.
IEEE 754 has 3 basic components:

1. The Sign of Mantissa –


This is as simple as the name. 0 represents a positive number while 1 represents a negative number.

2. The Biased exponent –


The exponent field needs to represent both positive and negative exponents. A bias is added to the
actual exponent in order to get the stored exponent.

3. The Normalised Mantissa –


The mantissa is part of a number in scientific notation or a floating-point number, consisting of its
significant digits. Here we have only 2 digits, i.e. O and 1. So a normalised mantissa is one with only one
1 to the left of the decimal.
IEEE 754 numbers are divided into two based on the above three components: single precision and double
precision.

single precision IEEE 754 floating point standard

double precision IEEE 754 floating point standard

Ex1: 85.125 is represented in single precision floating point as below,

 First convert it to binary


6
85.125 = 1010101.001 = 1.010101001 x 2

 sign = 0
 biased exponent
127 + 6 = 133
 Normalised mantisa = 010101001 , we will add 0's to complete the 23 bits

The IEEE 754 Single precision is:

sign exponent mantisa

01010100100000000000000
0 10000101 we added 0's to complete the
23 bits
Ex2 : -10.625 is represented in single precision floating point as below.

 First convert it to binary

1010.1012 (the whole and the fractional part separately)

 Put it in standard form

1.010101x23

 Biased value for exponent

3+127 = 13010

 exponent part(130) in binary

100000102

 Sign = 1

The IEEE 754 Single precision is:

sign exponent mantisa

1 10000010 01010100000000000000000

Advantage Disadvantage

Fixed Point Representation Performance good. No need to rely Limited range of values can
on additional hardware or represent
software logic
Floating point representation Greater range of numbers is More storage space needed.
represented. Varying degrees of Slower processing times. Lack of
precision. precision
Competency level 3.2: Analyses how characters are represented in computers

Following are different coding systems used.

BCD - Binary Coded Decimal

This coding system was used in the early stages of computing. In this system one digit is represented by 4 bits.
This is used only to represent decimal numbers. Sixteen symbols (24 = 16) can be represented in this system.
The table 3.15 shows the BCD codes for the 10 digits from 0 to 9.

ASCII – American Standard Code for Information Interchange

Normally uses 8 bits (1 byte) to store each character. However, the 8th bit is used as a check digit, meaning
that only 7 bits are available to store each character. This gives ASCII the ability to store a total of 27 = 128
different values . The 7 bit ASCII code was originally proposed by the American National Standard Institute
(ANSI). (IBM personal computers use ASCII).
EBCDIC – Extended Binary Coded Decimal Interchange Code

We can write only 128 characters using ASCII system, but the EBCDIC code system allows the use of 256
characters. Here, one symbol can be written with a binary number which consists of 8 bits. Hence, 256
characters can be represented using this system. This system was used in IBM main frame computers. The
table below shows that there are different EBCDIC codes for the 26 different capital letters and 26 different
EBCDIC codes for the 26 simple letters in this system.

UNICODE – Though 128 characters can be used in the ASCII system and 256 characters can be used in the
EBCDIC system for data representation. For example, these systems cannot be used for Sinhala, Japanese,
Chinese and Tamil languages as there are more than 256 characters. Hence Unicode system was designed
according to a standard to represent 65536 different symbols of 16 bits.
Competency level 3.3: Uses basic arithmetic and logic operations on binary numbers

Example :- Find 101012 AND 111002, 101012 OR 111002, 101012 XOR 111002

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy