0% found this document useful (0 votes)
13 views

Basic Digital - Systems

Uploaded by

T MaungLwin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Basic Digital - Systems

Uploaded by

T MaungLwin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 63

Basic Digital Electronics (EP)

Basic Digital Systems and Binary Numbers

By

Mr. Dashi Gam Awng


Lead Trainer
EP Dept; VTC. MJY
November 2024
Content !
 Digital Systems
 Numbers Systems
 Decimal , Octal and Hexadecimal
Numbers
 Binary Numbers
 Number-Base Conversions
 Binary Logic
Digital Systems
 Digital age and information age
 Digital computers
◆ General purposes
◆ Many scientific, industrial and commercial applications
 Digital systems
◆ Telephone switching exchanges
◆ Digital camera
◆ Electronic calculators, Digital Meter
◆ Digital TV,Digital Calculators, etc
 Discrete information-processing systems
◆ Manipulate discrete elements of information
◆ For example, {1, 2, 3, …} and {A, B, C, …}…
Analog and Digital Signal
 Analog system
◆ The physical quantities or signals may vary continuously over a specified
range.
 Digital system
◆ The physical quantities or signals can assume only discrete values.
◆ Greater accuracy

X(t) X(t)

t t
Analog signal Digital signal
Binary Digital Signal
 An information variable represented by physical quantity.
 For digital systems, the variable takes on discrete values.
◆ Two level, or binary values are the most prevalent values.
 Binary values are represented abstractly by:
◆ Digits 0 and 1
◆ Words (symbols) False (F) and True (T)
◆ Words (symbols) Low (L) and High (H) V(t)
◆ And words On and Off
 Binary values are represented by values Logic 1
or ranges of values of physical quantities.
undefine

Logic 0
t
Binary digital signal
Decimal (Base 10) Number System
 Base (also called radix) = 10
◆ 10 digits { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }
 Digit Position
◆ Integer & fraction Position 2 1 0 -1 -2
 Digit Weight
◆ Weight = (Base) Position
5 1 2 7 4
 Magnitude Weight 100 10 1 0.1 0.01
◆ Sum of “Digit x Weight”

 Formal Notation
Magnitude 500 10 2 0.7 0.04

d2*B2+d1*B1+d0*B0+d-1*B-1+d-2*B-2

(512.74)10
Octal (Base 8) Number System
 Base = 8
◆ 8 digits { 0, 1, 2, 3, 4, 5, 6, 7 }
 Weights
◆ Weight = (Base) Position Weight 64 8 1 1/8 1/64

 Magnitude 5 1 2 7 4
◆ Sum of “Digit x Weight” Position 2 1 0 -1 -2
 Formal Notation
Magnitude 5 *82+1 *81+2 *80+7 *8-1+4 *8-2
=(330.9375)10

(512.74)8
Hexadecimal (Base 16) Number System
 Base = 16
◆ 16 digits { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F }
 Weights
◆ Weight = (Base) Position 256 16 1 1/16 1/256

 Magnitude 1 E 5 7 A
◆ Sum of “Digit x Weight”
2 1 0 -1 -2
 Formal Notation
1 *162+14 *161+5 *160+7 *16-1+10 *16-2
=(485.4765625)10

(1E5.7A)16
Binary (Base 2) Number System
 Base = 2
◆ 2 digits { 0, 1 }, called binary digits or “bits”
 Weights
Position Weight 4 2 1 1/2 1/4
◆ Weight = (Base)
 Magnitude 1 0 1 0 1
◆ Sum of “Bit x Weight” Position 2 1 0 -1 -2
 Formal Notation 1 *22+0 *21+1 *20+0 *2-1+1 *2-2
 Groups of bits =(5.25)10
Summary
(101.01)2
➢ Bit: 1 binary digit (0 or 1)
➢ Nibble: 4 bits 1011
➢ Byte: 8 bits 11000101
➢ Word: Typically 16, 32, or 64 bits (depends on architecture)
Convert binary to decimal

Binary 0 1 10 11 100 101 110 111 1000 1001 1010 1011 1100 1101 1110 1111

Decimal 0 1 2 3 4 5 6 7 8 9 10 11 ? ? ? ?
Convert binary to decimal
Example 1: Convert the binary number 10101110 to decimal.

Solution:
Given binary number is 10101110 (110101110) = 430
Using the conversion formula,
10101110 = (1 × 2 7 ) + (0 × 2 6 ) + (1 × 2 5 ) + (0 × 2 4 ) + (1 × 2 3 ) + (1 ×
2 2 ) + (1 × 2 1 ) + (0 × 2 0 )
= 128 + 0 + 32 + 0 + 8 + 4 + 2 + 0
= 174

Therefore, binary number 10101110 = 174 decimal number


Convert binary to decimal
Example 2: Convert the binary number 11010111 to decimal.

Example 3: Convert the binary number 1111010111 to (983) decimal.


Convert binary to decimal
Example 2: Convert the binary number 11010111 to decimal.

Solution:
Given binary number is 11010111
Using the conversion formula,
11010111 = (1 × 2 7 ) + (1 × 2 6 ) + (0 × 2 5 ) + (1 × 2 4 ) + (0 × 2 3 ) +
(1 × 2 2 ) + (1 × 2 1 ) + (1 × 2 0 )
= 128 + 64 + 0 + 16 + 0 + 4 + 2 + 1
= 215

Therefore, binary number 11010111 = 215 decimal number


What is the difference between a bit, nibble, byte, and word in
computer terminology?
1. Bit
•Definition: A bit (binary digit) is the smallest unit of data in a computer and can have a value of
either 0 or 1.
•Usage: Bits are the building blocks of all digital data and are used in various contexts, such as
data transmission and storage.

2. Nibble
•Definition: A nibble consists of 4 bits.
•Usage: It is often used in computing to represent a single hexadecimal digit, as each
hexadecimal digit corresponds to 4 bits.

3. Byte
•Definition: A byte is a unit of digital information that typically consists of 8 bits.
•Usage: Bytes are commonly used to encode a single character of text in computer systems (e.g.,
ASCII). They are also the standard unit for measuring data storage (e.g., kilobytes, megabytes).

4. Word
•Definition: A word is a unit of data that is typically defined by the architecture of a computer's
CPU. The size of a word can vary, commonly being 16 bits, 32 bits, or 64 bits, depending on the
system.
•Usage: Words are used as the standard data size for processing in a computer's CPU, affecting
how data is handled in memory and how instructions are executed.
The Power of Base 2
n 2n n 2n
0 20=1 8 28=256
1 21=2 9 29=512
2 22=4 10 210=1024 Kilo

3 23=8 11 211=2048
4 24=16 12 212=4096
5 25=32 20 220=1M Mega

6 26=64 30 230=1G Giga

7 27=128 40 240=1T Tera


Bit, Nibble, Byte & Kilobyte
Megabyte, Gigabyte & Terabyte
Petabyte & Exabyte
Zettabyte & Yottabyte
Binary Information Group
 Binary Information Group

Table 1: Binary Information Group Representations and Terms

Number of Bits Common Representation Terms

1 Bit / Digit / Flag

4 Nybble / Nibble

8 Byte / Octet / Character

16 Double Byte / Word

32 Double Word / Long Word

64 Quad Word/ Very Long Word


Decimal Addition

 Decimal Addition Sample

1 1 Carry
5 5
+ 5 5

1 1 0
Binary Addition
 Binary Addition

Note that in the binary addition system:


0+0=0
0+1=1
1+0=1
1 + 1 = 0, carry over the 1, i.e. 10
Binary Addition Key
 Binary Addition

Key Addition Results for Binary Numbers


1 + 0 = 1

1 + 1 = 10

1 + 1 + 1 = 11

Key Subtraction Results for Binary Numbers


1 – 0 = 1

10 – 1 = 1

11 – 1 = 10
Example 1
 Binary Addition

Calculate the followings, using binary numbers:

(a) 111 + 100

(b) 101 + 110

(c) 1111 + 111


Example 1 Answers
 Binary Addition

Answers:

(a) 111 + 100 1011

(b) 101 + 110 1011

(c) 1111 + 111 10110


Binary Subtraction

 Binary Subtraction
Binary Subtraction Table
The subtraction of binary numbers is given by:

Binary Number Subtraction Value

0–0 0

1–0 1

0–1 1 (Borrow 1 from the next high order digit)

1–1 0
Binary Subtraction Key

 Binary Subtraction Sample

Key Addition Results for Binary Numbers


1 + 0 = 1

1 + 1 = 10

1 + 1 + 1 = 11

Key Subtraction Results for Binary Numbers


1 – 0 = 1

10 – 1 = 1

11 – 1 = 10
Example 2
 Binary Subtraction

Calculate the followings, using binary numbers:

(a) 111 – 101

(b) 110 – 11

(c) 1100 – 101


Example 2 Answers
 Binary Subtraction

Answers:

(a) 111 – 101 10


(b) 110 – 11 11
(c) 1100 – 101 111
Addition Exercises
 Question 1
Calculate the binary numbers:
(a) 11 + 1
(b) 11 + 11
(c) 111 + 11
(d) 111 + 10
(e) 1110 + 111
(f) 1100 + 110
(g) 1111 + 10101
(h) 1100 + 11001
(i) 1011 + 1101
(j) 1110 + 10111
(k) 1110 + 1111
(l) 11111 + 11101
Answers for Exercises
 Answers for Question 1
Addition Exercises

Binary Addition
**Reminder: 1 + 1 = 10**

Questions

1. 101 + 11 =
2. 111 + 111 =
3. 1010 + 1010 =
4. 11101 + 1010 =
5. 11111 + 11111 =
Answers for Exercises
Subtraction Exercises
 Question 2
Calculate the binary numbers:
(a) 11 – 10
(b) 110 – 10
(c) 1111 – 110
(d) 100 – 10
(e) 100 – 11
(f) 1000 – 11
(g) 1101 – 110
(h) 11011 – 110
(i) 1111 – 111
(j) 110101 – 1010
(k) 11011 – 111
(l) 11110 – 111
Answers for Exercises
 Answers for Question 2
Subtraction Exercises
 Binary Subtraction

**Reminder: 10 - 1 = 1**

Questions
6. 110 - 10 =
7. 101 - 11 =
8. 1001 - 11 =
9. 1101 - 11 =
10. 10001 - 100 =
Answers for Exercises
 Binary Subtraction
Binary Multiplication
 Bit by bit

Note that in the binary system:


0×0=0
0×1=0
1×0=0
1×1=1
Binary Multiplication
 Bit by bit : very similar to decimal multiplication

1 0 1 1 1
x 1 0 1 0
0 0 0 0 0
1 0 1 1 1
0 0 0 0 0
1 0 1 1 1

1 1 1 0 0 1 1 0
Binary Multiplication Exercises

 Bit by bit

Binary Multiplication
**Hint: very similar to decimal multiplication**

Questions

11. 10 x 10 =
12. 100 x 11 =
13. 101 x 10 =
14. 1011 x 11 =
15. 11011 x 101 =
Answers
 Bit by bit
Binary Division Rules
 Bit divided by bit
The binary division is much easier than the decimal division
when you remember the following division rules.
The main rules of the binary division include:
•1÷1 = 1
•1÷0 = Meaningless
•0÷1 = 0
•0÷0 = Meaningless
Binary Division Examples
Example 1: Solve using the long division method: 101101 ÷ 101

Solution:

Therefore, the resultant value is quotient


value which is equal to 1001
So, 101101 ÷ 101 = 1001
Binary Division Examples
Example 2.
Question: Solve 01111100 ÷ 0010
Solution:
Given01111100 ÷ 0010
Here the dividend is 01111100, and the divisor is 0010
Remove the zero’s in the Most Significant Bit in both the
dividend and divisor, that doesn’t change the value of the
number.
So the dividend becomes 1111100, and the divisor becomes 10.
Binary Division Examples
Now, use the long division method.

Therefore, the resultant value is quotient


value which is equal to 111110
So, 01111100 ÷ 0010 = 111110
Number Base Conversions
Evaluate
Magnitude
Octal
(Base 8)

Evaluate
Magnitude
Decimal Binary
(Base 10) (Base 2)

Hexadecimal
(Base 16)
Evaluate
Magnitude
Decimal (Integer) to Binary Conversion

 Divide the number by the ‘Base’ (=2)


 Take the remainder (either 0 or 1) as a coefficient
 Take the quotient and repeat the division

Example: (13)10
Quotient Remainder Coefficient
13/ 2 = 6 1 a0 = 1
6 /2= 3 0 a1 = 0
3 /2= 1 1 a2 = 1
1 /2= 0 1 a3 = 1
Answer: (13)10 = (a3 a2 a1 a0)2 = (1101)2

MSB LSB
Decimal (Fraction) to Binary Conversion

 Multiply the number by the ‘Base’ (=2)


 Take the integer (either 0 or 1) as a coefficient
 Take the resultant fraction and repeat the division

Example: (0.625)10
Integer Fraction Coefficient
0.625 * 2 = 1 . 25 a-1 = 1
0.25 * 2 = 0 . 5 a-2 = 0
0.5 *2= 1 . 0 a-3 = 1
Answer: (0.625)10 = (0.a-1 a-2 a-3)2 = (0.101)2

MSB LSB
Decimal to Octal Conversion
Example: (175)10
Quotient Remainder Coefficient
175 / 8 = 21 7 a0 = 7
21 / 8 = 2 5 a1 = 5
2 /8= 0 2 a2 = 2
Answer: (175)10 = (a2 a1 a0)8 = (257)8

Example: (0.3125)10
Integer Fraction Coefficient
0.3125 * 8 = 2 . 5 a-1 = 2
0.5 *8= 4 . 0 a-2 = 4
Answer: (0.3125)10 = (0.a-1 a-2 a-3)8 = (0.24)8
Binary − Octal Conversion
 8 = 23
Octal Binary
 Each group of 3 bits represents an octal digit
0 000
1 001
2 010
Assume Zeros
Example: 3 011

( 1 0 1 1 0 . 0 1 )2 4 100
5 101
6 110
( 2 6 . 2 )8 7 111

Works both ways (Binary to Octal & Octal to Binary)


Binary − Hexadecimal Conversion
 16 = 24 Hex Binary
 Each group of 4 bits represents a hexadecimal 0 0000
1 0001
digit
2 0010
3 0011
4 0100
5 0101
Assume Zeros 6 0110
Example:
7 0111

( 1 0 1 1 0 . 0 1 )2 8 1000
9 1001
A 1010
B 1011
C 1100
(1 6 . 4 )16 D 1101
E 1110
F 1111
Works both ways (Binary to Hex & Hex to Binary)
Octal − Hexadecimal Conversion
 Convert to Binary as an intermediate step

Example:
( 2 6 . 2 )8

Assume Zeros Assume Zeros

( 0 1 0 1 1 0 . 0 1 0 )2

(1 6 . 4 )16

Works both ways (Octal to Hex & Hex to Octal)


Decimal, Binary, Octal and Hexadecimal
Decimal Binary Octal Hex
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
Binary Logic
 Definition of Binary Logic
◆ Binary logic consists of binary variables and a set of logical operations.

◆ The variables are designated by letters of the alphabet, such as A, B, C, x, y, z, etc,


with each variable having two and only two distinct possible values: 1 and 0,
◆ Three basic logical operations: AND, OR, and NOT.
Binary Logic
 Truth Tables, Boolean Expressions, and Logic Gates

AND OR NOT
x y z x y z x z
0 0 0 0 0 0 0 1
0 1 0 0 1 1 1 0
1 0 0 1 0 1
1 1 1 1 1 1

z=x•y=xy z=x+y z = x = x’

x x x
y z y z z
Examples for Switching Circuits

AND OR
From Boolean Algebra to Ladder Diagram
From Boolean Algebra to Ladder Diagram
Binary Logic

 Logic gates
◆ Example of binary signals

3
Logic 1
2
Un-define
1
Logic 0
0

Figure 1.3 Example of binary signals


Binary Logic

 Logic gates
◆ Graphic Symbols and Input-Output Signals for Logic gates:

Fig. 1.4 Symbols for digital logic circuits

Fig. 1.5 Input-Output signals for gates


Binary Logic

 Logic gates
◆ Graphic Symbols and Input-Output Signals for Logic gates:

Fig. 1.6 Gates with multiple inputs


THANK YOU For Your Participation!
Assessment Questions!
 (1) အ ောက်ပါအပေးထောေးအ ော Logic Gates မ ောေး ောေး Truth Tables နှင ် Ladder Diagram
ဖြင ် အ ေး ောေးအြော်ဖပပါ။
 (a) AND (b) OR (c) NOT (d) NAND (e) NOR
 (f) XOR (g) XNOR
 (2) Binary Digits မ ောေးကို အြော်ဖပပါ။
 (3) PLC နှင ် ပတ် တ်အ ော Number System (4) မ ေး ောေး အြော်ဖပပါ။
 (4) 1 Nibble တွင ် မည်မျှ Bits ရှ နည်ေး။
 (5) အ ောက်တင ွ အ
် ြော်ဖပထောေးမှုမ ောေး ောေး Nibble, Byte, Word ခွဖွဲ ခောေးဖပပါ။

Bit LSB
MSB

1 0 1 1 1 0 0 1 1 0 1 0 1 0 1 1
(a) ?
(b) ?
(c) ?

You might also like