You are on page 1of 7

Logic Design

Basics of Computers - Number Systems


What is a Bit?
A bit (short for binary digit) is the smallest unit of data in a computer. A bit has a single
binary value, either 0 or 1.
Bits are the smallest unit of storage in a binary system - that is, the smallest unit of
information processed by a computer. Information is stored as 0 or 1.
Inside a computer, you can think of a bit as being a mechanical switch, which can be either
switched on or off (the earliest computers actually stored information in memory using
mechanical switches, with electromagnets to turn each one on or off(.
Now if you only have one of these switches, you can only store two different states, on or
off. This is useful in itself, you can record that something is either true or false...
But if you have, say, eight of them, you can store 256 different combinations of on and off
states between the eight switches.
What is a Byte?
Byte, the basic unit of information in computer storage and processing. A byte consists of 8
adjacent binary digits (bits), each of which consists of a 0 or 1.
This total number (8) of bits is universally known as a byte.
Byte is a grouping of consecutive bits. Usually 8-bits represents a Byte. Generally we use
Byte(s) to represents characters; each byte can store the values from 0-255. That means, we
can store one of the character from 0-255; in 1 Byte.
Computer memory is measured in terms of how many bits it can store. Here is a chart for
memory capacity conversion:
 1 byte (B) = 8 bits
 1 Kilobytes (KB) = 1024 bytes
 1 Megabyte (MB) = 1024 KB
 1 Gigabyte (GB) = 1024 MB
 1 Terabyte (TB) = 1024 GB
 1 Exabyte (EB) = 1024 PB
 1 Zettabyte = 1024 EB
 1 Yottabyte (YB) = 1024 ZB

What are the number systems in Computer?


Number systems are the technique to represent numbers in the computer system
architecture, every value that you are saving or getting into/from computer memory has a
defined number system.
The technique to represent and work with numbers is called number system. Decimal
number system is the most common number system. Other popular number systems include
binary number system, octal number system, hexadecimal number system.
System and Description:

1
Number System Conversion Table

Binary Numbers Octal Numbers Decimal Numbers Hexadecimal Numbers

0000 0 0 0

0001 1 1 1

0010 2 2 2

0011 3 3 3

0100 4 4 4

0101 5 5 5

0110 6 6 6

0111 7 7 7

1000 10 8 8

1001 11 9 9

1010 12 10 A

1011 13 11 B

1100 14 12 C

1101 15 13 D

1110 16 14 E

1111 17 15 F

Convert a number from one number system to another


Conversion between number bases:

2
Decimal to Other Bases :
Converting a decimal number to other base numbers is easy. We have to divide the decimal
number by the converted value of the new base.
Decimal to Binary Number:
Suppose if we have to convert decimal to binary, then divide the decimal number by 2.
Example 1. Convert (25)10 to binary number.
Solution: Let us create a table based on this question.
Operation Output Remainder

25 ÷ 2 12 1(MSB)

12 ÷ 2` 6 0

6÷2 3 0

3÷2 1 1

1÷2 0 1(LSB)

Therefore, from the above table, we can write, (25)10 = (11001)2

Decimal to Octal Number:


To convert decimal to octal number we have to divide the given original number by 8 such
that base 10 changes to base 8. Let us understand with the help of an example.
Example 2: Convert 12810 to octal number.
Solution: Let us represent the conversion in tabular form.
Operation Output Remainder

128÷8 16 0(MSB)

16÷8 2 0

2÷8 0 2(LSB)

Therefore, the equivalent octal number = 2008

3
Decimal to Hexadecimal:
Again in decimal to hex conversion, we have to divide the given decimal number by 16.
Example 3: Convert 12810 to hex.
Solution: As per the method, we can create a table;
Operation Output Remainder

128÷16 8 0(MSB)

8÷16 0 8(LSB)

Therefore, the equivalent hexadecimal number is 8016


Here MSB stands for a Most significant bit and LSB stands for a least significant bit.
Other Base System to Decimal Conversion:
Binary to Decimal:
In this conversion, binary number to a decimal number, we use multiplication method, in
such a way that, if a number with base n has to be converted into a number with base 10,
then each digit of the given number is multiplied from MSB to LSB with reducing the
power of the base. Let us understand this conversion with the help of an example.
Example 1. Convert (1101)2 into a decimal number.
Solution: Now, multiplying each digit from MSB to LSB with reducing the power of the
base number 2.
1 × 23 + 1 × 22 + 0 × 21 + 1 × 20
=8+4+0+1
= 13 Therefore, (1101)2 = (13)10
Example 2: Convert (10110.001)2 into a decimal number.
Solution: We multiplied each bit of (10110.001)2 with its respective positional weight, and
last we add the products of all the bits with its weight.
(10110.001)2=(1×24)+(0×23)+(1×22)+(1×21)+(0×20)+(0×2-1)+(0×2-2)+(1×2-3)
(10110.001)2=(1×16)+(0×8)+(1×4)+(1×2)+(0×1)+ (0×1⁄2)+(0×1⁄4)+(1×1⁄8)
(10110.001)2=16+0+4+2+0+0+0+0.125
(10110.001)2=(22.125 )10
Hexadecimal to Decimal:
Example 1: Convert 12116 to decimal number.
Solution: 1 x 162 + 2 x 161 + 1 x 160
= 16 x 16 + 2 x 16 + 1 x 1
= 289 Therefore, 12116 = 28910
Octal to Decimal:
To convert octal to decimal, we multiply the digits of octal number with decreasing power
of the base number 8, starting from MSB to LSB and then add them all together.
Example 1: Convert 228 to decimal number.
1 0
Solution: 2 x 8 + 2 x 8
= 16 + 2
= 18 Therefore, 228 = 1810

4
Example 2: Convert (152.25)8 to decimal number.
Solution: We multiply each digit of 152.25 with its respective positional weight, and last
we add the products of all the bits with its weight.
2
(152.25)8=(1×8)+(5×81)+(2×80)+(2×8-1)+(5×8-2)
(152.25)8=64+40+2+(2×1⁄8)+(5×1⁄64)
(152.25)8=64+40+2+0.25+0.078125
(152.25)8 = 106.328125
Octal to hexadecimal conversion
While converting from octal to hexadecimal unit, it is a usual practice to convert the octal
to hexadecimal by converting the octal number into binary digit and then further to from
binary to hexadecimal. For example to convert the number 536 from octal to hexadecimal.
Example: Convert (536)8 to hexadecimal number.
Convert (536)8 into its binary equivalent we get
(536)8 = (101) (011) (110)
(536)8 = (101011110)2
Now forming the group of 4 binary bits to obtain its hexadecimal equivalent,
(101011110)2= (0001) (0101) (1110)
= (15E)16 So the hexadecimal number of (536)8 is (15E)16.
Binary to Octal Conversion
The base numbers of binary and octal are 2 and 8, respectively. In a binary number, the
pair of three bits is equal to one octal digit. There are only two steps to convert a binary
number into an octal number which are as follows:
1. In the first step, we have to make the pairs of three bits on both sides of the binary point.
If there will be one or two bits left in a pair of three bits pair, we add the required
number of zeros on extreme sides.
2. In the second step, we write the octal digits corresponding to each pair.
Example 1: (111110101011.0011)2
1. Firstly, we make pairs of three bits on both sides of the binary point.
111 110 101 011.001 1
On the right side of the binary point, the last pair has only one bit. To make it a complete
pair of three bits, we added two zeros on the extreme side.
111 110 101 011.001 100
2. Then, we wrote the octal digits, which correspond to each pair.
(111110101011.0011)2 = (7653.14)8
Binary to Hexadecimal Conversion
The base numbers of binary and hexadecimal are 2 and 16, respectively. In a binary
number, the pair of four bits is equal to one hexadecimal digit. There are also only two steps
to convert a binary number into a hexadecimal number which are as follows:
1. In the first step, we have to make the pairs of four bits on both sides of the binary point.
If there will be one, two, or three bits left in a pair of four bits pair, we add the required
number of zeros on extreme sides.
2. In the second step, we write the hexadecimal digits corresponding to each pair.

5
Example 1: (10110101011.0011)2
1. Firstly, we make pairs of four bits on both sides of the binary point.
111 1010 1011.0011
On the left side of the binary point, the first pair has three bits. To make it a complete pair
of four bits, add one zero on the extreme side. 0111 1010 1011.0011
2. Then, we write the hexadecimal digits, which correspond to each pair.
(011110101011.0011)2 = (7AB.3)16
Hexadecimal to Binary Shortcut Method
To convert hexadecimal numbers to binary and vice versa is easy, you just have to
memorize the table given below.
Hexadecimal Number Binary

0 0000

1 0001

2 0010

3 0011

4 0100

5 0101

6 0110

7 0111

8 1000

9 1001

A 1010

B 1011

C 1100

D 1101

E 1110

F 1111

You can easily solve the problems based on hexadecimal and binary conversions with the
help of this table. Let us take an example.
Example: Convert (89)16 into a binary number.
Solution: From the table, we can get the binary value of 8 and 9, hexadecimal base
numbers.
8 = 1000 and 9 = 1001
Therefore, (89)16 = (10001001)2

6
Octal to Binary Shortcut Method
To convert octal to binary number, we can simply use the table. Just like having a table for
hexadecimal and its equivalent binary, in the same way, we have a table for octal and its
equivalent binary number.
Octal Number Binary

0 000

1 001

2 010

3 011

4 100

5 101

6 110

7 111

Example: Convert (214)8 into a binary number.


Solution: From the table, we know,
2 → 010
1 → 001
4 → 100
Therefore, (214)8 = (010001100)2

You might also like