You are on page 1of 11

1/26/2024

Computer Architecture
Numbering Systems
By Thilina Wanshathilaka

This image cannot currently be display ed.

Lesson Plan Introduction


01 • What is numbers
• How numbers evolve
• Why computers use binary system

Decimal ,Binary ,Octal and Hex numbers


02 • Decimal ,Binary ,Octal and Hex numbers
• Number conversion
• Arithmetic Operations

Representation of Decimal Numbers


03 • Signed vs Unsigned representations.
• Signed integer representations: Signed Magnitude, One's
Complement, Two's Complement.
• Arithmetic Operations
• Examples and applications.

Closing Todays Lecture


04 • Summary Of Todays lecture
• Q &A
• Next Lecture

What is numbers

• A number is a mathematical concept used to quantify and represent


quantities. Numbers can be integers (whole numbers without fractions
or decimals), rational numbers (numbers that can be expressed as a
ratio of two integers), irrational numbers (numbers that cannot be
expressed as a simple fraction), real numbers (which include both
rational and irrational numbers), and complex numbers (which have
both a real and an imaginary part).
• Numbers are used for various purposes in mathematics and everyday
life, such as counting, measuring, ordering, and performing
mathematical operations like addition, subtraction, multiplication, and
division. They play a fundamental role in many branches of
mathematics, science, and technology.

1
1/26/2024

Evolution of Numbers

• Tally Marks: One of the earliest methods of counting involved tally marks, where
people would make marks on a surface, such as sticks or stones, to represent
quantities. Tally marks are simple and intuitive and were likely one of the first ways
humans counted.
• Babylonian Number System (c. 2000 BCE): The Babylonians developed a positional
number system based on the number 60. This system used a base-60 (sexagesimal)
system, which influenced the division of hours, minutes, and seconds that we still
use today.
• Egyptian Hieroglyphs (c. 3000 BCE): The ancient Egyptians used a hieroglyphic
system for counting and recording numbers. They had symbols for each power of 10,
but the system lacked a clear concept of zero.
• Roman Numerals (c. 500 BCE - 400 CE): The Roman numeral system, which used
combinations of letters from the Latin alphabet to represent numbers, was widely
used in the Roman Empire. However, Roman numerals were not well-suited for
arithmetic operations.

Evolution of Numbers
• Indian Decimal System (c. 600 CE): The decimal system, based on powers of 10 and including
a symbol for zero, originated in India. It was later transmitted to the Islamic world and
Europe. This system laid the foundation for the modern decimal numeral system.
• Arabic Numerals (c. 9th - 10th centuries): The Indian numeral system was transmitted to the
Islamic world, where it was further developed and adopted. The use of Arabic numerals (1, 2,
3, etc.) and the concept of zero gradually spread to Europe during the Middle Ages.
• Introduction of Zero (c. 7th - 9th centuries): The concept of zero, crucial for the development
of a place-value system, was introduced to the mathematical world through Indian and
Islamic scholars. It became an integral part of the numeral systems in use today.
• The Renaissance and Scientific Revolution (14th - 17th centuries): During the Renaissance,
there was a resurgence of interest in ancient mathematical ideas, and new developments in
algebra and geometry emerged. The acceptance of decimal notation and the use of
positional notation with a zero became more widespread.
• Modern Decimal System (17th century - present): The modern decimal system, based on the
use of Arabic numerals and a place-value system, became the standard for mathematics and
everyday arithmetic. It is the system used worldwide today.

Computer Math

• Computers use the binary (base-2) numbering system for several fundamental
reasons related to the underlying architecture and design of electronic
circuits. Here are some key reasons why binary is used in computers
• Simplicity of Electronic Implementation: Electronic circuits in computers are based on
binary switches that can be either in an "on" state (representing 1) or an "off" state
(representing 0). This binary nature of electronic switches makes the design and
implementation of circuits simpler and more reliable.
• Reliability and Noise Immunity: Binary signals are less susceptible to errors caused by
noise in electronic circuits. The clear distinction between the "on" and "off" states makes
it easier to detect and correct errors, ensuring the reliability of data transmission and
storage.
• Ease of Miniaturization: Binary digits (bits) can be represented physically using smaller
and more compact electronic components. This is crucial for modern computing devices
where the miniaturization of components allows for the creation of smaller, faster, and
more powerful computers

2
1/26/2024

Computer Math
• Efficient Representation of Digital Information: Binary is well-suited for representing digital
information. By using just two digits (0 and 1), computers can efficiently represent and
manipulate data. This simplicity facilitates the design of logic circuits and the development of
algorithms for processing information.

• Logical Operations: Binary logic is straightforward to implement using basic logic gates such
as AND, OR, and NOT gates. These gates form the basis of digital logic circuits, allowing
computers to perform logical operations necessary for computation and decision-making.

• Compatibility with Semiconductor Memory: The memory in computers, such as RAM


(Random Access Memory) and ROM (Read-Only Memory), is based on semiconductor
technology. Binary is a natural fit for encoding information in semiconductor memory, as the
presence or absence of charge can represent the binary states

Computer Math

• Standardization and Compatibility: The use of binary is a standardized convention


across the computer industry. This standardization ensures compatibility among
different hardware and software components. It allows information to be easily
shared and processed across a wide range of computing systems.

• Mathematical Simplicity: Binary arithmetic is simpler than decimal arithmetic due to


the limited number of digits (0 and 1). This simplicity facilitates efficient and fast
mathematical operations in digital circuits.

• Communication with External Devices: Many external devices, such as input/output


devices and communication interfaces, are designed to work with binary data. Using
binary as the fundamental representation allows computers to communicate
seamlessly with various peripherals and external systems.

Convert Decimal to Binary

2 270
2 135 0

2 62 1

2 36 0

2 18 0

2 9 0

2 4 1

2 2 0

1 0

3
1/26/2024

Convert Decimal to Binary


• Convert following numbers to binary
• 17 • 51
•3 • 44
• 15 • 56
• 255 • 23
• 67
• 89
• 72

Convert Binary to Decimal


• Convert 1101000 to Decimal

26 25 24 23 22 21 20
1 1 0 1 0 0 0
64 +32+0 + 8 + 0+ 0+0 =104

Convert Binary to Decimal


• Convert following numbers to Decimal
• 1101000 • 1111100
• 111 • 1010010
• 1011010 • 1110010
• 111000 • 11111111
• 1010010
• 11010001
• 1100111

4
1/26/2024

Convert Floating Decimal to Binary


• Convert 0.575 to binary
0.575 x2
1 .150 x2
0 .300 x2

0 .600 x2

1 .200 x2

0 .400 x2

………….. = 0.10010….

Converting Floating Decimal to Binary


• Convert following numbers to binary
• 0.17 • 0.0051
• 0.73 • 0.044
• 0.015 • 0.56
• 0.255 • .23
• 0.067
• 0.89
• 0.0072

Convert Binary to Octal


• Convert 1011101000 to Octal

29 28 27 26 25 24 23 22 21 20
1 0 1 1 1 0 1 0 0 0
1 3 5 0

=13508

5
1/26/2024

Converting Binary to Octal


• Convert following numbers to binary
• 1101000 • 1111100
• 111 • 1010010
• 1011010 • 1110010
• 111000 • 11111111
• 1010010
• 11010001
• 1100111

Convert Binary to Hexadecimal


• Convert 1011101000 to Hexadecimal

29 28 27 26 25 24 23 22 21 20
1 0 1 1 1 0 1 0 0 0
2 E 8

=2E816

Converting Binary to hexadecimal


• Convert following numbers to binary
• 1101000 • 1111100
• 111 • 1010010
• 1011010 • 1110010
• 111000 • 11111111
• 1010010
• 11010001
• 1100111

6
1/26/2024

Binary Addition and substation

Signed integer representations

• Signed integer representations are methods used to represent


both positive and negative integers in computer systems. These
representations include
• Signed Magnitude
• One's Complement
• Two's Complement
• Signed integer representation allows for the representation of
both positive and negative numbers within a finite set of bits. This
is crucial in various applications, such as arithmetic calculations
and data storage, where values can be both positive and negative.

Signed integer representations


Signed Magnitude
• In signed magnitude representation, the leftmost bit (most
significant bit) is used to represent the sign of the number. 0
indicates a positive number, and 1 indicates a negative number.
• The remaining bits represent the magnitude (absolute value) of
the integer.
• For example, in a 4-bit signed magnitude system:
• +5 is represented as 0101
• -5 is represented as 1101

7
1/26/2024

Signed integer representations


Signed Magnitude
• In Unsigned representation using n number of bits we can
represent maximum value 2n.But in signed representation it will
reduced to 2n-1 .
• 8 bit unsigned representation
• 11111111 =28 =256
• 8 bit signed representation
• 0 1111111=27 =128

• Sign Bit Magnitude

Signed integer representations


One's Complement
• In one's complement representation, the sign bit is still used to denote
the sign (0 for positive, 1 for negative).
• To represent the magnitude of a positive number, the binary
representation is used as is. For negative numbers, the one's
complement of the positive number is taken.
• One's complement is obtained by flipping all the bits of the positive
binary representation (changing 0s to 1s and vice versa).
• For example, in a 4-bit one's complement system:
• +5 is represented as 0101
• -5 is represented as 1010

Signed integer representations


One's Complement representing -57 using 8 bit
• First write +57 using 8 bits sign magnitude.

0 0 1 1 1 0 0 1

• Flip 1 to 0 and 0 to 1 (Not operation)

1 1 0 0 0 1 1 0

8
1/26/2024

Signed integer representations


Two's Complement
• Two's complement representation is similar to one's complement, but
with a slight modification in the way negative numbers are represented.
• The positive numbers are represented as in standard binary form, while
the negative numbers are obtained by taking the two's complement of
the positive binary representation.
• The two's complement is obtained by adding 1 to the one's
complement representation.
• For example, in a 4-bit two's complement system:
• +5 is represented as 0101
• -5 is represented as 1011 (0101 + 1)

Signed integer representations


Two's Complement representing -57 using 8 bit
• First write +57 using 8 bits sign magnitude.
0 0 1 1 1 0 0 1

• Flip 1 to 0 and 0 to 1 (Not operation)


1 1 0 0 0 1 1 0 +1
• Add 1 to once compliment
1 1 0 0 0 1 1 1

Signed Magnitude Arithmetic Operation

• Signed Magnitude Positive • Signed Magnitude Negative


Arithmetic Operation Arithmetic Operation
• 34+15=49 34+(-15)=19
0 1 0 0 0 1 0 =34 0 1 0 0 0 1 0 =34
+ 0 0 0 1 1 1 1 =15 + 1 0 0 1 1 1 1 =-15
0 1 1 0 0 0 1 =49 1 1 1 0 0 0 1 =-49

9
1/26/2024

Two’s Compliment Arithmetic Operation

• Two’s Compliment Positive • Two’s Compliment Negative


Arithmetic Operation Arithmetic Operation
• 34+15=49 34+(-15)=19
0 1 0 0 0 1 0 =34 0 1 0 0 0 1 0 =34
+ 0 0 0 1 1 1 1 =15 + 1 1 1 0 0 0 1 =-15
0 1 1 0 0 0 1 =49 10 0 1 0 0 1 1 = 19

Two's Complement

• Primary Usage:
• Almost universally used in modern computers for representing signed integers.
• Provides a straightforward method for addition and subtraction, simplifying
arithmetic operations.
• Allows for efficient implementation of mathematical operations like addition,
subtraction, and multiplication.
• Reasons for Prevalence:
• Eliminates the need for special correction in arithmetic operations, making it
more efficient.
• Only one representation for zero simplifies calculations.
• Consistent behavior across arithmetic operations and ease of implementation in
hardware.

One's Complement

• Historical Usage:
• Historically used in some early computers and architectures.
• Requires special handling for end-around carry in arithmetic operations.
• Current Relevance:
• Rarely used in contemporary systems for general-purpose arithmetic.
• May be encountered in certain legacy systems or specialized applications.

10
1/26/2024

Signed Magnitude:

• Limited Usage:
• Rarely used in modern computing for general-purpose arithmetic.
• Simple conceptually but introduces complexities in arithmetic operations.
• Specialized Cases:
• May be used in specialized applications where explicit representation of
sign and magnitude is required.
• Limited to scenarios where arithmetic operations are not the primary
concern.

Any Questions ?

THANK YOU
End Of Session 1

11

You might also like