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

Chapter11 Numbering

The document discusses different number systems including binary, octal, decimal, and hexadecimal. It provides details on: - The main types of number systems are binary, octal, decimal, and hexadecimal. Binary uses digits of 1 and 0, octal uses 0-7, decimal uses 0-9, and hexadecimal uses 0-9 and A-F. - Computers use the binary system as digital circuits can only be in two states, on or off. Binary is also easy to transmit and store reliably in computers. - Other topics covered include bits, bytes, nibbles, conversion between number systems, binary arithmetic, signed and unsigned numbers, and one's and two's complement representations.

Uploaded by

sivanesshni
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)
36 views

Chapter11 Numbering

The document discusses different number systems including binary, octal, decimal, and hexadecimal. It provides details on: - The main types of number systems are binary, octal, decimal, and hexadecimal. Binary uses digits of 1 and 0, octal uses 0-7, decimal uses 0-9, and hexadecimal uses 0-9 and A-F. - Computers use the binary system as digital circuits can only be in two states, on or off. Binary is also easy to transmit and store reliably in computers. - Other topics covered include bits, bytes, nibbles, conversion between number systems, binary arithmetic, signed and unsigned numbers, and one's and two's complement representations.

Uploaded by

sivanesshni
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/ 35

▪ A number system is defined as the

representation of numbers by using digits or


other symbols in a consistent manner.
▪ There are different types of number systems
in which the four main types are as follows.
• Binary number system (Base - 2)
• Octal number system (Base - 8)
• Decimal number system (Base - 10)
• Hexadecimal number system (Base - 16)
BINARY NUMBER SYSTEM
Binary is a base 2 number system, meaning that
all numbers and other data can only represented
using ones and zeros. All modern computer
systems store data and programs in binary.
The computers can only understand instructions
in 0s and 1s, which is a binary number system
with base 2. The whole computer language and
programming are based on the binary number
system, and the digital encoding process is
executed in 0s and 1s.
BINARY NUMBER SYSTEM
Why do computers use binary?
There are a number of advantages to using binary in computer systems:
• Binary data can be transmitted easily and reliably.
• Binary data can be stored and read very easily and reliably.
• Computers use circuits that can only be on one of 2 states – on or off, these work very well
with binary calculations.
• The input voltage into computers is not very stable, so only a system that use voltage/no
voltage would be reliable.

https://youtu.be/k-5jpns0uTA
BITS, BYTES & NIBBLES
Bit – e.g. 0
▪ Each individual 1 or 0 is known as a bit.
▪ Here are three bits – 110
Byte – e.g. 11001100
▪ Each group of 8 bits is known as a Byte
▪ Here is a stream of Bytes:
01010011 01101011 01111001 01110010 01101001 01101101 00100000 01101001
01110011 00100000 01100001 01110111 01100101 01110011 01101111 01101101
01100101 00100001
Nibble – e.g. 1111
▪ A nibble is 4 bits, or half a Byte.
▪ Here is a nibble – 1101
OCTAL NUMBER SYSTEM
The octal number system uses eight digits: 0,1,2,3,4,5,6 and 7 with the base of 8.
The advantage of this system is that it has lesser digits when compared to several other
systems, hence, there would be fewer computational errors.
Digits like 8 and 9 are not included in the octal number system. Just as the binary, the octal
number system is used in minicomputers but with digits from 0 to 7.
For example: 358, 238, 1418 are some examples of numbers in the octal number system.
DECIMAL NUMBER SYSTEM
The decimal number system uses ten digits: 0,1,2,3,4,5,6,7,8 and 9 with the base number as 10.
The decimal number system is the system that we generally use to represent numbers in real
life.
If any number is represented without a base, it means that its base is 10. For example: 72310,
3210, 425710 are some examples of numbers in the decimal number system.
HEXADECIMAL NUMBER SYSTEM
The hexadecimal number system uses sixteen digits/alphabets: 0,1,2,3,4,5,6,7,8,9 and
A,B,C,D,E,F with the base number as 16.
Here, A-F of the hexadecimal system means the numbers 10-15 of the decimal number system
respectively.
This system is used in computers to reduce the large-sized strings of the binary system. For
example, 7B316, 6F16, 4B2A16 are some examples of numbers in the hexadecimal number
system.
DECIMAL TO BINARY CONVERSION
BINARY TO DECIMAL CONVERSION
Lets play a game!!

https://games.penjee.com/binary-
bonanza/game.php
BINARY TO HEXADECIMAL
CONVERSION
HEXADECIMAL TO BINARY
CONVERSION
BINARY CODED DECIMAL (BCD)
Binary Coded Decimal is a form of binary representation where each denary
digit is converted individually into binary, rather than the whole number
being converted as a large number.

Example 1 – the number 42


Normally this number would be converted directed to binary as 00101010 as 8 bit binary.
BINARY CODED DECIMAL (BCD)
However, in binary coded decimal we would convert the number 4 to binary and the number 2
to binary, then simply concatenate(combine) the 2 numbers together

Therefore 42 in BCD binary would be 0100 0010


BINARY CODED DECIMAL (BCD)
Example 2

356

Decimal to Binary
=> (356)10 = (000101100100)2

BCD
=> 0011 0101 0110
BINARY CODED DECIMAL(BCD)
Why use Binary Coded Decimal?
Binary coded decimal has 3 main advantages
• It is easier for a human to read large binary numbers than if the number is in pure binary
• It is simpler to create hardware than only counts in decimal and uses basic calculation (e.g.
digital clocks, simple calculators)
• Binary coded decimal removes the problem of floating point rounding errors, which makes is
very useful for handling financial transactions.
BINARY CODED DECIMAL
CLOCK DEMONSTRATION PROJECT
BINARY CODED DECIMAL
FINANCIAL SYSTEMS
In binary systems decimals numbers are stored using a floating point representation.
When representing fractions of a whole some numbers cannot be stored accurately using
binary, due to the fractions not fitting perfectly within a binary base 2 system.
This results in a floating point rounding error. In financial systems rounding errors are
unacceptable and must be dealt within. For this reason, binary coded decimal is used instead.
CONVERTING TEXT TO BINARY
Converting text to binary is a simple process. You simply look up the decimal value for the
character in the ASCII table below, and then convert that value from decimal to binary.
ASCII
Pros
• Very easy to read, write and understanding ASCII code, simple for a human
being to memorize each character.
• Small storage and transmission size ( 7 bits for standard ASCII 8bits for
extended ASCII)
Cons
▪ Only works for the English language, limited number of special characters.
UNICODE
It became clear that a system with a much large number of available characters was required
and hence Unicode was invented.
Pros
▪ Millions of different characters available due to the larger number of bits per character ( 16 or
32 bits)
Cons
▪ 2 or 4 times more storage space taken up per letter.

An example of a few of hundreds of thousands


of Unicode characters available
https://unicode-table.com/en/#control-
character
CONVERTING BINARY TO TEXT
Converting from binary to text is nice and simple. You simply convert each binary number to a
decimal number and then look up that number on the ASCII table.

Try it out!
https://www.rapidtables.com/convert/number/ascii-to-binary.html
TRY IT!!
1. Convert these text examples to binary:

a. dog

b. cat

c. Mouse

d. Your name

2. Convert these binary examples to text:

d. 01100101 01100111 01100111

e. 01101000 01100001 01101101

f. 01100011 01101000 01101001 01110000 01110011


Prefixes are used to specify multiples and submultiples of a
unit. The decimal prefixes are based on powers of 10.
DECIMAL PREFIXES
▪ Decimal Prefixes – Kilo / Mega / Giga / Tera
▪ The most common prefix system used is the Decimal Prefix system. This is the system we use
every day: Kilogram, Megabyte, Kilometer
▪ The decimal prefix system works by each prefix being 1000 times larger than the previous
prefix:
• 1 KiloByte = 1000Bytes (10^3)
• 1 MegaByte = 1000 KiloBytes = 1,000,000 Bytes ( 10^6)
• 1 GigaByte = 1000 MegaBytes = 1,000,000,000 Bytes ( 10^9)
• 1 TeraByte = 1000 GigaBytes = 1,000,000,000,000 Bytes ( 10^12)
BINARY PREFIXES
Binary Prefixes – Kibi / Mebi / Gibi / Tebi
This works well where we humans count in denary (Powers of 10) but computers count in binary
(Powers of 2) and therefore we need to use a binary prefix instead – Kibi, Mebi, Gibi, Tebi
• 1 KiB = 1024 Bytes ( 2 ^10)
• 1 MiB = 1024 KiB ( 2^20)
• 1 GiB = 1024 MiB ( 2^30)
• 1 TiB = 1024 GiB ( 2^40)
Consumers are used to using kilo, mega, giga, etc.
This meant that when personal computers became
popular manufacturers of software and hardware
began to use the system inconsistently (KB could
mean either 1000 or 1024 bytes). There was an
attempt to fixing this through the implementation of
the IEC standard, however Microsoft being Microsoft
refused to adopt international standards, stating (just
like they did with IE until everyone stopped using it).
Apple’s iOS and some versions of Linux follow the
international standard.
BINARY - ADDITION
BINARY - SUBTRACTION
SIGNED & UNSIGNED NUMBERS
An unsigned number contains just zero or positive
values, whereas a signed number has both positive
and negative numbers along with the value zero.
The maximum value of signed numbers is half that
of unsigned numbers.
When utilizing 8 bits of binary numbers, there are
only 256 possible combinations. Any value between
0 and 255 is considered an unsigned number.
Having a signed number means you've already lost a
bit for representing the sign. With 7 bits, you can
only have 128 permutations. Hence an 8-bit signed
number's range is -128 to 127.
Using unsigned numbers was the way to go if you
had limited resources, which was the case in the
early days of computers.

https://youtu.be/4qH4unVtJkE
ONE’S COMPLIMENT
▪ To get 1's complement of a binary number, simply invert the given number. For
example, 1's complement of binary number 110010 is 001101.
▪ There are various uses of 1’s complement of Binary numbers, mainly in signed
Binary number representation and various arithmetic operations for Binary
numbers, e.g., additions, subtractions, etc.
▪ 1’s complement binary numbers are very useful in signed number representation.
Positive numbers are simply represented as Binary number. There is nothing to do
for positive binary number. But in case of negative binary number representation,
we represent in 1’s complement. If the number is negative, then it is represented
using 1’s complement. First represent the number with positive sign and then take
1’s complement of that number.
TWO’S COMPLIMENT
To get 2's complement of binary number is 1's complement of given number plus 1 to the
least significant bit (LSB).
Example-1 − Find 2’s complement of binary number 10101110.
Simply invert each bit of given binary number, which will be 01010001. Then add 1 to the LSB
of this result.
01010001
+1
01010010

Example-2 − Find 2’s complement of binary number 10001.001.


01110.110
+1
01110.111

You might also like