You are on page 1of 36

CSE 223: Digital Electronics

Topic 1 : Introduction and Number System Conversions

Md. Jayed Hossain

Lecturer

Department of Computer Science and Engineering

Daffodil International University


Introduction

❑ An analog quantity is one having continuous values. A digital quantity is one having a discrete set of
values.

➢ Digital data can be processed and transmitted more efficiently


➢ Digital data has a great advantage when storage is necessary

Dept. of CSE Daffodil International University 1


Introduction

Dept. of CSE Daffodil International University 1


Introduction

❑ Each of the two digits in the binary system, 1 and 0, is called a bit
❑ In digital circuits, two different voltage levels are used to represent the two bits.
❑ Generally, 1 is represented by the higher voltage, which we will refer to as a HIGH, and a 0
is represented by the lower voltage level, which we will refer to as a LOW.

➢ Digital waveforms consist of voltage levels that are changing back and forth between the HIGH and LOW levels or states.

Dept. of CSE Daffodil International University 1


Introduction

Dept. of CSE Daffodil International University


Introduction

❑ The frequency ( f ) of a pulse (digital) waveform ❑ An important characteristic of a periodic digital


is the reciprocal of the period. The relationship waveform is its duty cycle, which is the ratio of
between frequency and period is expressed as the pulse width (tW) to the period (T ). It can be
follows: expressed as a percentage.

Dept. of CSE Daffodil International University


Introduction

Dept. of CSE Daffodil International University


Introduction

❑ A timing diagram is a graph of digital waveforms showing the actual time relationship of two or more waveforms
and how each waveform changes in relation to the others.

Dept. of CSE Daffodil International University


Introduction

Flip-flop, Latch, Counter and …..

Dept. of CSE Daffodil International University


1. Decimal Number System

❑ The decimal system is composed of 10 numerals or symbols, 0 through 9, represents a certain quantity.
❑ The decimal system, also called the base-10 system, because it has 10 digits
❑ The decimal system is a positional-value system in which the value of a digit depends on its position.
❑ Positional value or weight, expressed as a power of 10.
❑ The most significant bit (MSB) is the leftmost bit (largest weight). The least significant bit (LSB) is the
rightmost bit (smallest weight).

27.35
= 2 × 10 + 7 × 1 + 3 × 0.1 + 5 × 0.01

Dept. of CSE Daffodil International University 1


2. Binary Number System

❑ Almost every digital system uses the binary (base-2) number system.
❑ The binary system with its two digits is a base-two system (0 and 1).
❑ The binary system is also a positional-value system.
❑ Positional value or weight, expressed as a power of 2.
❑ In the binary system, the term binary digit is often abbreviated to the term bit.
❑ Places to the left of the binary point (counterpart of the decimal point) are positive powers of 2 and places
to the right are negative powers of 2.

There are four bits to the left of the binary point, representing
the integer part of the number, and three bits to the right of the
binary point, representing the fractional part.

The MSB has a weight of 23; the LSB has a weight of 2-3

Dept. of CSE Daffodil International University 1


3. Binary to Decimal Conversion

➢ To find the equivalent in the decimal system, we simply take the sum of the products of each digit
value (0 or 1) and its positional value:

Dept. of CSE Daffodil International University 1


4. Decimal to Binary Conversion

➢ A systematic method of converting whole numbers from decimal to binary is the repeated division-
by-2 process:

✓ Divide the decimal number by 2.


✓ Then divide each resulting quotient by 2 until there is a 0
whole-number quotient.
✓ The remainders generated by each division form the binary
number.
✓ The first remainder to be produced is the LSB (least
significant bit) in the binary number, and the last remainder
to be produced is the MSB (most significant bit).

Dept. of CSE Daffodil International University 1


4. Decimal to Binary Conversion (Contd.)

➢ Decimal fractions can be converted to binary by repeated multiplication by 2:

✓ To convert the decimal fraction binary, begin by multiplying


by 2.
✓ Then 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.

Dept. of CSE Daffodil International University 1


5. Binary and Decimal Counting

In decimal number system:

❑ Using only two decimal places, we can count through 102


= 100 different numbers (0 to 99) and the largest number
is 99.
✓ In general, with N places or digits, we can count through
10N different numbers. The largest number will always be
10N - 1.

In binary number system:

✓ In general, with N places or digits, we can count through


2N different numbers. The largest number will always be
2N – 1.

✓ Similar approach for hexadecimal and octal

Dept. of CSE Daffodil International University 1


5. Binary and Decimal Counting (Contd.)

Example:

Dept. of CSE Daffodil International University


6. Hexadecimal Number System

❑ 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.
❑ The hexadecimal system is also a positional-value system.
❑ The digit positions are weighted as powers of 16.
❑ The most significant bit (MSB) is the leftmost bit (largest weight). The least
significant bit (LSB) is the rightmost bit (smallest weight).

Dept. of CSE Daffodil International University 1


7. Binary to Hexadecimal Conversion

➢ Simply break the binary number into 4-bit groups.


➢ Starting at the right-most bit and replace each 4-bit group with the equivalent hexadecimal symbol.

Dept. of CSE Daffodil International University 1


8. Hexadecimal to Binary Conversion

➢ Reverse the process and replace each hexadecimal symbol with the appropriate four bits.

Dept. of CSE Daffodil International University 1


9. Hexadecimal to Decimal Conversion

➢ To convert a hexadecimal number to its decimal equivalent is to multiply the decimal value of each
hexadecimal digit by its weight
➢ Then take the sum of these products.

Dept. of CSE Daffodil International University 1


10. Decimal to Hexadecimal Conversion

➢ Repeated division of a decimal number by 16 will produce the equivalent hexadecimal number, formed by the
remainders of the divisions.
➢ Each successive division by 16 yields a remainder that becomes a digit in the equivalent hexadecimal number.
➢ When a quotient has a fractional part, the fractional part is multiplied by the divisor to get the remainder.

Dept. of CSE Daffodil International University 1


11. Hexadecimal Counting

Dept. of CSE Daffodil International University


12. Octal Number System

❑ The octal number system is composed of eight digits, which are 0, 1, 2, 3, 4, 5, 6, 7


❑ The base is 8 for octal number system.
❑ The digit positions are weighted as powers 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

Dept. of CSE Daffodil International University 1


13. Decimal to Octal Conversion

✓ Similar to the method used in the conversion of decimal numbers to binary/hexadecimal

Dept. of CSE Daffodil International University 1


14. Octal to Binary Conversion

➢ To convert an octal number to a binary number, simply replace each octal digit with the appropriate three bits.

Dept. of CSE Daffodil International University


15. Binary to Octal Conversion

✓ Reverse of the octal-to-binary conversion.

Dept. of CSE Daffodil International University


16. Other Conversions
Fractional Decimal to Octal/Hexadecimal Conversion:
➢ Multiply with 16 for hexadecimal
➢ 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.

✓ Another way is that - convert the decimal with integer and fractional part in binary and finally convert binary to
octal or hexadecimal.

Hex to Octal or Octal to Hex Conversion:


✓ Simply convert the hexadecimal number to binary number and then convert this binary to octal
number and vice-versa for octal to hex conversion.

Base‐r system
In general, a number expressed in a base‐r system has coefficients multiplied by powers of r.
An example of a base‐5 number is
(4021.2)5 = 4 × 53 + 0 × 52 + 2 × 51 + 1 × 50 + 2 × 5-1 = (511.4)10
Decimal (base 10) Binary (base 2) Octal (base 8) Hexadecimal (base 16)
00 0000 00 0
01 0001 01 1
02 0010 02 2
03 0011 03 3
04 0100 04 4
05 0101 05 5
06 0110 06 6
07 0111 07 7
08 1000 10 8
09 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
❑ Most computer manuals use either octal or hexadecimal numbers to specify binary quantities
17. Binary Addition, Subtraction, Multiplication and Division

Example:

Dept. of CSE Daffodil International University


17. Binary Addition, Subtraction, Multiplication and Division (Contd.)

Example:

Dept. of CSE Daffodil International University


17. Binary Addition, Subtraction, Multiplication and Division (Contd.)

Example:

Dept. of CSE Daffodil International University


17. Binary Addition, Subtraction, Multiplication and Division (Contd.)

❑ Division in binary follows the same procedure as division in


decimal

Example:

Dept. of CSE Daffodil International University


18. Complements of Numbers

❑ Complements are used in digital computers to simplify the subtraction operation


❑ There are two types of complements for each base‐r system: the radix complement
and the diminished radix complement.
❑ The first is referred to as the r’s complement and the second as the (r - 1)’s
complement.
❑ The two types are referred to as the 2’s complement and 1’s complement for binary
numbers and the 10’s complement and 9’s complement for decimal numbers.

Dept. of CSE Daffodil International University


19. Complements for Decimal Number
Diminished radix complement
❖ The 9’s complement of a decimal number is obtained by subtracting each digit from 9.

❑ 9’s complement of 546700

999999
- 546700
453299

Radix complement

The 10’s complement of decimal is obtained by adding 1 to the 9’s complement value.

The 10’s complement of 546700 is


453299 +1
= 453300

Dept. of CSE Daffodil International University


20. Complements of Binary Numbers
❖ The 1’s complement of a binary number is found by changing all 1s to 0s and all 0s to 1s

❖ The 2’s complement of a binary number is found by adding 1 to the LSB of the 1’s complement.

Dept. of CSE Daffodil International University


References

1. Digital Systems Principles and Applications - Ronald J. Tocci (Section 2.1 to 2.3)
2. Digital Design – Morris Mano (Section 1.2 to 1.5)
3. Digital Fundamentals - Thomas L. Floyd (Section 2.1 to 2.5)
** Example math from these sections

Dept. of CSE Daffodil International University

You might also like