Digital Logic Design- Chapter Two - Modified - Copy (1)
Digital Logic Design- Chapter Two - Modified - Copy (1)
By Getahun N.
Decimal Numbers SYSTEM
The decimal system is Composed of 10 numerals or symbols.
These 10 symbols are 0, 1, 2, 3,….., 9;
Using these 10 symbols as digits of a number, we can express any
quantity.
The decimal system, also called the base-10 system because it has 10
digits.
The position of each digit in a decimal number indicates the
magnitude of the quantity represented and can be assigned a weight.
Decimal Numbers SYSTEM
The weights for whole numbers are positive powers of 10 that
increase from right to left, beginning with 10° = 1.
For fractional numbers, the weights are negative powers of ten that
decrease from left to right beginning with 10-1.
The value of a decimal number is the sum of the digits after each
digit has been multiplied by its weight.
Decimal Numbers SYSTEM
.
Binary Numbers SYSTEM
The binary number system has two digits (bits).
The two binary digits (bits) are 1 and 0.
The position of a 1 or 0 in a binary number indicates its weight.
The weights in a binary number are based on powers of two.
The right-most bit is the LSB (least significant bit) in a binary whole
number and has a weight of 20 = 1.
The weights increase from right to left by a power of two for each bit.
Binary Numbers SYSTEM
The left-most bit is the MSB (most significant bit).
The left-most bit is the MSB in a binary fractional number and has a
weight of 2-1 = 0.5.
The fractional weights decrease from left to right by a negative power
of two for each bit.
Generally, the weight structure of a binary number is
Example:-
..
Decimal to Binary Conversion
A. SUM-OF-WEIGHTS METHOD:
One way to find the binary number that is equivalent to a given
decimal number is to determine the set of binary weights whose
sum is equal to the decimal number.
Example: Convert the decimal number 49 to binary.
Solution: Write down column weights until the last number is larger
than the one you want to convert.
B. REPEATED MULTIPLICATION BY 2 :-
Multiplying each resulting fractional part of the product by 2 until
the fractional product is zero or until the desired number of
decimal places is reached.
The carry digits, or carries, generated by the multiplications
produce the binary number.
The first carry produced is the MSB, and the last carry is the LSB.
Converting Decimal Fractions to Binary
EXAMPLE: Convert the decimal fraction 0.188 to binary by
repeatedly multiplying the fractional results by 2.
SOLUTION:
EXAMPLE:- Subtract the binary number 00111 from 10101 and show
the equivalent decimal subtraction.
SOLUTION:-
Solution:
OCTAL NUMBERS
The octal number system is composed of eight digits, which are 0, 1,
2, 3, 4, 5, 6, 7
The octal number system has a base of 8.
Octal-to-Decimal Conversion:
The evaluation of an octal number in terms of its decimal
equivalent is accomplished by multiplying each digit by its weight
and summing the products.
Octal-to-Binary Conversion:-
Because each octal digit can be represented by a 3-bit binary
number, it is very easy to convert from octal to binary.
OCTAL TO BINARY
To convert an octal number to a binary number, simply replace
each octal digit with the appropriate three bits.
Example:- Convert each of the following octal numbers to
binary:
Binary-to-Octal Conversion
Conversion of a binary number to an octal number is the reverse of
the octal-to-binary conversion.
Start with the right-most group of three bits and, moving from right to
left, convert each 3-bit group to the equivalent octal digit.
Example:- Convert each of the following binary numbers to octal:
QUIZ 1 [5%]
Convert to binary
Binary-Coded Decimal CODE (BCD)
Human Perception:
We naturally live in a base 10 environment(decimal number
system)
Computer exist in a base 2 environment (binary number system)
So give the computer/digital system the task of doing the
conversions for us.
Binary-Coded Decimal CODE (BCD)
Binary coded decimal means that each decimal digit, 0 through 9, is
represented by a binary code of four bits.
Binary coded decimal (BCD) is a weighted code that is commonly
used in digital systems when it is necessary to show decimal numbers
such as in clock displays.
The 8421 code is a type of BCD (binary coded decimal) code.
The designation 8421 indicates the binary weights of the four bits (23 ,
22 , 21 ,20 ).
Invalid Codes:-The six code combinations that are not used in BCD.
These are: 1010, 1011, 1100, 1101, 1110, and 1111
BCD
The table illustrates the difference
between straight binary and BCD.
BCD represents each decimal digit
with a 4-bit code.
Notice that the codes 1010 through
1111 are not used in BCD.
DECIMAL TO BCD CONVERSTION
To express any decimal number in BCD, simply replace each decimal
digit with the appropriate 4-bit code, as shown by Example:
Example:- Convert each of the following decimal numbers to BCD: