0% found this document useful (0 votes)
12 views19 pages

Practical Class 2

Uploaded by

arai.tuleuova28
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
Download as ppt, pdf, or txt
0% found this document useful (0 votes)
12 views19 pages

Practical Class 2

Uploaded by

arai.tuleuova28
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1/ 19

Number System

A number system is defined as a system of writing to express numbers.


It is the mathematical notation for representing numbers of a given set by using
digits or other symbols in a consistent manner.

Humans use the DECIMAL system (“deci” stands for “ten”)

To convert data into strings of numbers, computers use the BINARY number
system
Elementary storage units inside computers are electronic switches.
Each switch holds one of two states: on (1) or off (0).
ON OFF

We use a bit (binary digit), 0 or 1, to represent the state.


0 (00)
1 (01)
2 (10)
3 (11)
Bits and Bytes
• A bit is the smallest unit of information a computer can use, having a value of 1 or 0.
• Computers work with collections of bits, grouping them to represent larger pieces of data,
such as letters of the alphabet.
• Eight bits make up one byte. A byte is the amount of memory needed to store one
alphanumeric character.
• With one byte, the computer can represent one of 256 different symbols or characters.

1 01 10 1 01 01 1 01
Common Number Systems

System Base Symbols


Decimal 10 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Binary 2 0, 1
Octal 8 0, 1, 2, 3, 4, 5, 6, 7, 10, ….
Hexa- 16 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
decimal A, B, C, D, E, F, 10, …
Quantities/Counting
Hexa- Hexa-
Decimal Binary Octal decimal Decimal Binary Octal decimal

0 0 0 0 8 1000 10 8
1 1 1 1 9 1001 11 9
2 10 2 2 10 1010 12 A
3 11 3 3 11 1011 13 B
4 100 4 4 12 1100 14 C
5 101 5 5 13 1101 15 D
6 110 6 6 14 1110 16 E
7 111 7 7 15 1111 17 F
Decimal to Binary
Repeated Division-by-2 Method (for whole number)

To convert a whole number to binary, use successive division by 2 until the quotient
is 0. The remainders form the answer, with the first remainder as the least
significant bit (LSB) and the last as the most significant bit (MSB).
(43)10 = (101011)2
Example
12510 = ?2 2 125
2 62 1
2 31 0
2 15 1
2 7 1
2 3 1
1 1

12510 = 11111012
Binary to Decimal
• Technique
– Multiply each bit by 2n, where n is the “weight” of
the bit
– The weight is the position of the bit, starting from
0 on the right
– Add the results
Example
Bit “0”

1010112 => 1 x 20 = 1
1 x 21 = 2
0 x 22 = 0
1 x 23 = 8
0 x 24 = 0
1 x 25 = 32
4310
Decimal to Octal
• Technique
– Divide by 8
– Keep track of the remainder
Example
123410 = ?8

8 1234
8 154 2
8 19 2
8 2 3

123410 = 23228
Octal to Decimal
• Technique
– Multiply each bit by 8n, where n is the “weight” of
the bit
– The weight is the position of the bit, starting from
0 on the right
– Add the results
Example

7248 => 4 x 80 = 4
2 x 81 = 16
7 x 82 = 448
46810
Decimal to Hexadecimal
• Technique
– Divide by 16
– Keep track of the remainder
Example
123410 = ?16

16 1234
16 77 2
16 4 13 = D

123410 = 4D216
Hexadecimal to Decimal
• Technique
– Multiply each bit by 16n, where n is the “weight”
of the bit
– The weight is the position of the bit, starting from
0 on the right
– Add the results
Example

ABC16 => C x 160 = 12 x 1 = 12


B x 161 = 11 x 16 = 176
A x 162 = 10 x 256 = 2560
274810
Exercise – Convert ...
Hexa-
Decimal Binary Octal decimal
33
1110101
703
1AF

Don’t use a calculator!

Skip answer Answer


Exercise – Convert …
Answer

Hexa-
Decimal Binary Octal decimal
33 100001 41 21
117 1110101 165 75
451 111000011 703 1C3
431 110101111 657 1AF
Thank you

You might also like