Binary Number System

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 4

BINARY NUMBER SYSTEM :- Computers are electronic machines which operate using binary

logic. These devices use two different values to represent the two voltage levels (0V for logic 0 and
+5V for logic 1). The two values 0 and 1 therefore, correspond to the two digits used by the binary
number system. Some important terms in binary number system include:
 Bit: Bit is a short form of binary digit. It is the smallest possible unit of data. In computerized data
a bit can either be 0 or 1.
 Nibble: Nibble is a group of four binary digits.
 Byte: Byte is a group of eight bits. A nibble is a half byte. Bits 0 through 3 are called the low order
nibble, and bits 4 through 7 form the high order nibble.
 Word: A group of two bytes is called a word. Bits 0 through 7 form the low order byte and bits 8
through 15 form the high order byte. However, computers today have redefined word as a group of
4 bytes (32 bits).

Term Size (bits) Example

Bit 1 0

Nibble 4 1010

Byte 8 0101 1100

Word 16 0101 1100 0101 1100

Convert a binary number into a decimal number:- With binary number, all the columns
are powers of 2. Note that in the table, all the columns are specified in powers of 2. So in order to
convert a binary number into its decimal equivalent, multiply that place holder amount (power of 2) by
the digit, and then add them all up.
For example, let us convert 1101 into decimal
Decimal number = 1*23 + 1*22 + 0*21 + 1*20
= 1*8 + 1*4 + 0*2 + 1*1
=8+4+0+1
= 13

Number of digits- 2

Data values that can be represented = 22 = 4

0 00

1 01

2 10

3 11
Convert a Decimal number into a binary number
To convert decimal number into its binary equivalent, simply divide the decimal number by 2 and then
write down the remainder, repeat this process until you cannot divide by 2 anymore.
Let us convert decimal 13 or (13)10 into its binary equivalent
2 | 13 | R
2 | 6 | 1
2 | 3 | 0
2 | 1 | 1
2| 0 | 1
Now write the result starting from the last remainder obtained. Therefore, (13)10 = (1101)2
OCTAL NUMBER SYSTEM :- The octal numeral system, is the base-8 number system, and uses
the digits 0 to 7. This number system was used extensively in early mainframe computer systems, but
has become less popular when compared with binary and hexadecimal number systems.
In order to convert an octal number into its decimal equivalent, multiply that place holder amount
(power of 8) by the digit, and then add them all up.
For example, let us convert (123)8 into decimal
Now, use the above table to form the decimal number.
Decimal number = 1*82 + 2*81 + 3*80
= 1*64 + 2*8 + 3*1
= 64 + 16 + 3
= 83
Convert a Decimal Number into an Octal Number:- To convert decimal number into its octal
equivalent, simply divide the decimal number by 8 and then write down the remainder, repeat this
process until you cannot divide by 2 anymore.
Let us convert decimal 786 or (786)10 into its binary equivalent
8 | 786 | R
8 | 98 | 2
8 | 12 | 2
8 | 1 | 4
8| 0 | 1
Now write the result starting from the last remainder obtained. Therefore, (786)10 = (1422)8

HEXADECIMALNUMBER SYSTEM :-
 The hexadecimal numeral system is the base-16 number system.
 It uses sixteen distinct symbols- the symbols 0–9 to represent values zero to nine, and A, B, C,
D, E, F (or a to f) to represent values ten to fifteen.
 The main problem with binary numbers is that for larger values, binary numbers quickly
become too unwieldy. The hexadecimal (base 16) number system overcomes this problem as
hex numbers are very compact.
 It is very easy to convert from hex to binary and binary to hexadecimal.
 In hexadecimal, just like in the binary, octal and decimal number systems, we start counting in
the first column which represents the smallest unit, ones. Then, working from right to left, we
move to a 16s column; a 256s column; a 4096s column; a 65,536s column; and so forth.

Decimal Binary Hexa decimal


0 0000 0
1 0001 1
2 0010 2
3 0011 3
4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F
Convert Hexadecimal Number into Binary :- Break the binary number into 4-bit groups beginning
with the LSB and substitute the corresponding four bits in binary for each hexadecimal digit in the
number.
For example, convert OxABCD into its binary equivalent.
(ABCD)16 = (1010 1011 1100 1101)2
Convert Hexadecimal Number into Binary :- To convert a hexadecimal number into binary, first
pad the binary number with leading zeroes (if necessary) so that the binary number contains multiples
of four bits.
For example, let us convert the binary number 01101110010110 into hexadecimal.
Note that the given binary number contains 14 bits. Pad the number with two zeroes on the left so that
the number has 16 bits (multiple of 4 bits).
Now, the binary number = 0001 1011 1001 0110
The next step is to substitute the appropriate hexadecimal digits. The equivalent hex number = 1B96
Convert Hex to Decimal Number
Multiply the value in each position by its hex weight and add each value. For example, let us convert
0x312B into its equivalent decimal value.
Decimal number = 3*163 + 1*162 + 2*161 + B*160
= 3*4096 + 1*256 + 2*16 + B*1
= 12288 + 256 + 32 + 11
= 12587
Converting a Decimal Number to Hexadecimal
Divide the decimal number by 16 and then write down the remainder, repeat this process until you
cannot divide by 16 anymore.
Let us convert decimal 1239 into its hex equivalent
16 | 1239 | R
16 | 77 | 7
16 | 4 | D
16 | 0 | 4
Now write the result starting from the last remainder obtained. Therefore, (1239)10 = (4D7)8

You might also like