Chapter 2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

University of Gondar

Institute of Technology
Department of Electrical and Computer Engineering

By: Endalkachew D.
Chapter two
Numbering System and Data Representation
Outlines

❖Binary Systems

❖Number Base Conversions

❖Data Representation
Binary Systems
Digital systems have such a prominent role in everyday life that we refer to the
present technological period as the digital age.
Digital systems are used in
✓Communication,
✓Business transactions,
✓Traffic control,
✓Space guidance,
✓Medical treatment,
✓Weather monitoring,
✓Internet, and
✓Many other commercials, industrial, and scientific enterprises.
Cont.…
✓Digital systems manipulate discrete quantities of information that are represented
in binary form.
✓Operands used for calculations may be expressed in the binary number system.
✓A decimal number such as 7,392 represents a quantity equal to 7 thousand plus 3
hundred, plus 9 tens, plus 2 units
7392 = 7x10^3 + 3x10^2 + 9x10^1 + 2x10^0
A number with a decimal point is represented by a series of coefficients as follows:
D^5 d^4 d^3 d^2 d^1 d^0.d^-1 d^-2 d^-3
For example, the decimal number 26.75 can be represented
26.75 = 2x10^1 + 6x10^0 + 7x10^-1 + 5x10^-2
Cont.…
✓The decimal number system is said to be off base or radix, 10 because it uses 10
digits and the coefficients are multiplied by powers of 10.
✓The binary system is a different number system.
✓The coefficients of the binary numbers system have only two possible values: 0
or1.
✓Each coefficient d is multiplied by 2^n
For example, the decimal equivalent of the binary number 11010.11 is 26.75, as
shown from the multiplication of the coefficients by powers of 2:
1x2^4 + 1x2^3 + 0x2^2 + 1x2^1 + 0x2^0 + 1x2^-1 + 1x2^-2 = 26.75
Cont.…
Let us consider a base 5 number and its conversion to a decimal number
(𝟒𝟎𝟐𝟏.𝟐)𝟓 = 4x5^3 + 0x5^2 + 2x5^l + lx5^0 + 2x5^-l =(𝟓𝟏𝟏.𝟒)𝟏𝟎
The coefficient values for base 5 can be only 0, 1, 2, 3, and 4.
The octal number system is a base- 8 system that has eight digits: 0, 1, 2, 3, 4, 5, 6,
7.
An example of an octal number is 127.4
(𝟏𝟐𝟕.𝟒)𝟖 = 1x8^2 + 2x8^1 + 7x8^0 + 4x8^-1 = (𝟖𝟕.𝟓)𝟏𝟎
Number Base Conversions
The conversion of a number in base `r` to decimal is done by expanding the number
in a power series and adding all the terms
Example1
Convert decimal 41 to binary.
First, 41 is divided by 2 to give an integer quotient of 20 and a remainder of ½.
The quotient is again divided by 2 to give a new quotient and remainder.
This process is continued until the integer quotient becomes 0.
Cont.…
Quotient remainder Coefficient
41/2 20 1 a0=1
20/2 10 0 a1=0
10/2 5 0 a2=0
5/2 2 1 a3=1
2/2 1 0 a4=0
1/2 0 1 a5=1
The answer is (41)10 = (101001)2

The conversion from decimal integers to any base `r` system is similar to the
example, except that division is done by r instead of 2.
Cont.…
Example 2
Convert decimal 153 to octal.
The required base `r` is 8. First, 153 is divided by 8 to give an integer quotient of 19
and a remainder of 1. Then 19 is divided by 8 to give an integer quotient of 2 and a
remainder of 3. Finally, 2 is divided by 8 to give a quotient of 0 and a remainder of
2.
This process can be conveniently manipulated as follows:
Quotient remainder Coefficient
153/8 19 1 a0=1
19/8 2 3 a1=3
2/8 0 2 a2=2
The answer is (153)10 = (231)8
Cont.…
The conversion of a decimal fraction to binary is accomplished by a method similar
to that used for integers. However, multiplication is used instead of division, and
integers are accumulated instead of remainders.
Example
Convert (𝟎. 𝟔𝟖𝟕𝟓)𝟏𝟎 to binary.
First, 0.6875 is multiplied by 2 to give an integer and a fraction. The new fraction is
multiplied by 2 to give a new integer and a new fraction. This process is continued
until the fraction becomes 0 or until the number of digits has sufficient accuracy.
The coefficients of the binary number are obtained from the integers as follows:
Cont.…

Integer Fraction Coefficient


0.6875*2 1 0.375 a-1=1
0.375*2 0 0.75 a-2=0
0.75*2 1 0.5 a-3=1
0.5*2 1 0 a-4=1
The answer is (0.6875)10 = (0.1011)2
Cont.…
Exercise Convert (0.513)10 to octal.

Integer Fraction Coefficient


𝟎. 513*8 4 0.104 a-1=4
0.104*8 0 0.832 a-2=0
0.832*8 6 0.656 a-3=6
0.656*8 5 0.248 a-4=5
0.248*8 1 0.984 a-5=1
0.984*8 7 0.872 a-6=7
0.872*8 6 0.976 a-7=6
0.976*8 7 0.808 ..
0.808*8 6 0.464 ..
Cont.…
The conversion of decimal numbers with both integer and fraction parts is done by
converting the integer and the fraction separately and then combining the two
answers.
Example
(41.6875)10 = (101001.1011)2
The conversion from and to binary, octal, and hexadecimal plays an important role
in digital computers.
Since 2^3 = 8 and 2^4 = 16, each octal digit corresponds to three binary digits and
each hexadecimal digit corresponds to four binary digits.
Cont.…
The conversion from binary to octal is easily accomplished by partitioning the
binary number into groups of three digits each, starting from the binary point and
proceeding to the left and the right.
(10 110 001 101 011 111 100 000 110)2 = (26153.7460)8
Conversion from binary to hexadecimal is similar, except that the binary number is
divided into groups of four digits:
(10 1100 0110 1011. 1111 0010)2 = (2C6B.F2)16
Numbers with Different Bases
Class activity
1. Find the hexadecimal equivalent of 1100101.001010.
2. Convert (22)8 into its corresponding decimal number.
3. Convert the decimal number 168 to the binary equivalent.
4. Convert the decimal number 34.0625 to its octal equivalent.
Quiz (5%) Time allowed 5’
1. Convert the decimal number 152 to the binary equivalent and to hexadecimal
equivalent.
Data Representation
✓We enter data into a computer or review (see) output data from a computer using the
letter of the alphabet, various special symbols, and the numerals in the decimal number
system.
✓But since a computer is an electronic device that understands electrical flow (signal)
there is no letter, symbol, or number inside the computer.
✓The computer works with binary numbers.
✓As a semiconductor is conducting or isn’t conducting; a switch is closed or opened.
✓Therefore, every data and instruction inside computers is represented using two symbols
0 and 1.
✓Computers use the binary number system to represent numbers. This system uses only
two digits: 0 and 1.
✓Humans use the decimal system which uses ten symbols: 0, 1,9.
✓The binary number system works the same way as the decimal system but has only two
available symbols (digits) rather than ten.
Cont.…
Digital systems use signals that have two distinct values and circuit elements that
have two stable states.
Q??
Thank you!!

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy