You are on page 1of 31

University of Dhaka

Dept. of Robotics and Mechatronics Engineering


RME-2102: Digital Logic Circuit and Microprocessor

Lec-2: Number Systems and Codes


Ref: Digital Systems, Principles and Applications, by Ronald J. Tocci, Edition-12 (Chapter-2)

Md. Ariful Islam


Assistant Professor
Dept. of Robotics and Mechatronics Engineering
University of Dhaka

1
2
3
a) Procedure to convert fractional Decimal to Binary.

Step 1 : Multiply the decimal fraction by 2 and note the integer part. The
integer part is either O or 1.

Step 2 : Discard the integer part of the previous product. Multiply the fractional
part of the previous product by 2. Repeat step 1 until the same fraction repeats
or terminates (0).

Step 3 : The resulting integer part forms a sequence of 0’s and 1 ’s that
becomes the binary equivalent of decimal fraction.

Step 4 : The final answer is to be written from first integer part obtained till the
last integer part obtained.
4
5
The hexadecimal number system uses base 16.

Thus, it has 16 possible digit symbols.

It uses the digits 0 through 9 plus the letters A, B, C, D, E, and F

6
7
8
9
10
Binary to Octal Octal to Binary

11
Octal to Decimal

12
Octal to Hexa

13
If each digit of a decimal number is represented by its binary equivalent,
the result is a code called binary-coded decimal

14
15
A straight binary number takes the complete decimal number and
represents it in binary;

the BCD code converts each decimal digit to binary individually.

16
Compare the MSB
binary with the next
binary bit (B1). If they
are the same, then
G1 = 0. If they are
different, then G1 =
1. G0 can be found
by comparing B1 with
B0.
binary to Gray Gray to binary

17
Number system/code equivalents

18
19
20
errors can occur such that the receiver does not receive the identical
information that was sent by the transmitter.

Example of noise causing an error in the transmission of digital data.

 a certain degree of noise superimposed on the original signal.


 alter the logic level of the signal, as it does at point x.
 When this occurs, the receiver may incorrectly interpret that bit as a logic 1,
which is not what the transmitter has sent.
21
 A parity bit is an extra bit that is attached to a code group that is
being transferred from one location to another.
 The parity bit is made either 0 or 1, depending on the number of 1s
that are contained in the code group.

Two different methods are used.


 In the even-parity method, the value of the parity bit is chosen so that
the total number of 1s in the code group (including the parity bit) is an even
number.

 the character “A” is being transmitted and odd parity is being used.

22
Binary Operation
Addition
 0 + 0 = 0: When adding two binary digits, if both digits are 0, the sum is 0.
 0 + 1 = 1: When adding a 0 and a 1, the sum is 1.
 1 + 0 = 1: Adding a 1 and a 0 also gives a sum of 1.
 1 + 1 = 10: When adding two 1s, the sum is 10 (which is equivalent to binary
representation of decimal 2). In this case, the sum exceeds the base, so a
carry-over occurs, and the 1 is written as the rightmost digit of the sum, while
the carry-over (1) is written to the left.

23
Subtraction
 0 - 0 = 0: When subtracting two binary digits, if the minuend (the number
being subtracted from) and the subtrahend (the number being subtracted)
are both 0, the difference is 0.
 1 - 0 = 1: When subtracting a 0 from a 1, the difference is 1.
 1 - 1 = 0: When subtracting a 1 from a 1, the difference is 0.
 Borrowing: If the minuend digit is smaller than the subtrahend digit,
borrowing is required. Borrowing works similarly to decimal subtraction,
where you borrow 1 from the next higher-order digit.

24
Multiplication
 0 x 0 = 0: When multiplying two binary digits, if either or both digits are 0,
the product is 0.
 0 x 1 = 0: When multiplying a binary digit by 0, the product is always 0.
 1 x 1 = 1: When multiplying two binary digits, if both digits are 1, the product
is 1.
 Multiplication by powers of 2: When multiplying a binary number by a
power of 2 (which is represented by shifting the digits to the left), each digit
is shifted to the left by the corresponding number of positions.

25
Division
 Dividend: The number being divided is called the
dividend. It is the number that is being divided
into smaller parts.
 Divisor: The number by which the dividend is
divided is called the divisor. It is the number that
divides the dividend.
 Quotient: The result of the division is called the
quotient. It represents the whole number part of
the division result.
 Remainder: In binary division, there is also a
remainder, which represents the leftover part of
the division after the division is complete.

26
Register
In computing, a register refers to a small, high-speed storage location within the
central processing unit (CPU) of a computer.

It is used to store data that is being actively used or processed by the CPU.

27
Signed number
A signed number is a representation of a number that indicates its positive or
negative value.

It allows for the representation of both positive and negative numbers in a


number system, such as binary or decimal.

28
1's Complement and 2's Complement
To generate a 1's complement for any given binary number, you only need to
invert that number.

To generate a 2's complement for any given binary number, you need to invert
it. Then you need to add 1 to the LSB (Least Significant Bit) of the generated
result.

29
30
31

You might also like