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

Varun Kouda - Silicon Community

Digital logics and design

Silicon Community - Session 1

1
Varun Kouda - Silicon Community

Number Systems - Binary,


Decimal and Hexadecimal
Topic 1

2
Varun Kouda - Silicon Community

Binary Number System (1)


● The binary system is a base-2 system, meaning it uses
only two digits: 0 and 1.
● Each digit in a binary number is called a bit. The
position of each bit represents a power of 2.

Binary to Decimal:

● the binary number 1011 represents (1 * 2^3) + (0 *


2^2) + (1 * 2^1) + (1 * 2^0), which equals 11 in decimal.

3
Varun Kouda - Silicon Community

Binary Number System (2)


Binary to Hexadecimal:

● convert the binary number 1101101 to hexadecimal


● Step 1: Group the binary number into sets of four
digits (starting from left) - 1101 101
● Step 2: Put each 4 digits into hexadecimal - 1101 101
→ D5

4
Varun Kouda - Silicon Community

Decimal Number System


● The decimal system is the most familiar number system to
us, and it is a base-10 system.
● It uses ten digits: 0 to 9. Each digit position represents a
power of 10.
● For example, the decimal number 427 represents (4 *
10^2) + (2 * 10^1) + (7 * 10^0), which equals 427.

5
Varun Kouda - Silicon Community

Hexadecimal Number System


● The hexadecimal system is a base-16 system, using sixteen
digits: 0 to 9 and A to F.
● The digits beyond 9 are represented by letters A to F.
● Hexadecimal is often used in computer programming and
represents large binary numbers in a more compact form.
● For example, the hexadecimal number 1F3 represents (1 *
16^2) + (15 * 16^1) + (3 * 16^0), which equals 499 in
decimal

6
Varun Kouda - Silicon Community

Binary to Decimal and Hexadecimal


● To convert a binary number to decimal, multiply each digit by the
corresponding power of 2 based on its position, and sum up the
results.
● For example, to convert the binary number 1101 to decimal: (1 *
2^3) + (1 * 2^2) + (0 * 2^1) + (1 * 2^0) = 13.

convert the binary number 101101010011 to hexadecimal.

● Step 1: Group the binary number into sets of four digits, starting
from the right → 1011 0101 0011
● Step 2: Convert each group of four binary digits to their
hexadecimal equivalent.
7
● 1011 0101 0011 → B 5 3 → B53
Varun Kouda - Silicon Community

Decimal to Binary
● To convert a decimal number to binary, repeatedly divide the
decimal number by 2 and note down the remainders.
● The binary number is formed by reading the remainders in
reverse order.
Example:
convert the decimal number 26 to binary:
● 26 divided by 2 is 13 with a remainder of 0,
● 13 divided by 2 is 6 with a remainder of 1,
● 6 divided by 2 is 3 with a remainder of 0, and
● 3 divided by 2 is 1 with a remainder of 1.
● 1 divided by 2 is 0 with a remainder of 1
● The binary representation is 11010. 8
Varun Kouda - Silicon Community

Hexadecimal to Decimal
● To convert a hexadecimal number to decimal, multiply each
digit by the corresponding power of 16 based on its
position, and sum up the results.
● Replace any letters A to F with the corresponding decimal
values.

Example:

convert the hexadecimal number 2B to decimal:

● (2 * 16^1) + (11 * 16^0) = 43.


9
Varun Kouda - Silicon Community

Hexadecimal to Binary
convert the hexadecimal number A7F to binary.

Step 1: Convert each hexadecimal digit to its binary equivalent.

● A = 1010
● 7 = 0111
● F = 1111

Step 2: Combine the binary values of each digit.

● A7F in hexadecimal is equivalent to 101001111111 in binary.

.
10
Varun Kouda - Silicon Community

Practice Problems on Number systems


1. Convert the binary number 11011 to decimal.
2. Convert the decimal number 168 to binary.
3. Convert the decimal number 543 to hexadecimal.
4. Convert the hexadecimal number 2F to decimal.
5. Perform the binary addition: 1101 + 1010.
6. Perform the decimal subtraction: 735 - 219.
7. Perform the hexadecimal multiplication: 3B * 5.
8. Convert the binary number 10111001 to hexadecimal.
9. Convert the decimal number 92 to binary.
10. Convert the hexadecimal number 5C to decimal.
11
Varun Kouda - Silicon Community

Problems on Number systems (Level 2)


1. Convert the binary number 1110.0111 to decimal.
2. Convert the decimal number 1234 to binary.
3. Convert the decimal number 4096 to hexadecimal.
4. Convert the hexadecimal number ABCD to decimal.
5. Perform the binary addition: 101010 + 11011.
6. Perform the decimal subtraction: 54321 - 9876.
7. Perform the hexadecimal multiplication: CDEF * 2.
8. Convert the binary number 110011001100 to hexadecimal.
9. Convert the decimal number 987654 to binary.
10. Convert the hexadecimal number FEDCBA to decimal.
12
Varun Kouda - Silicon Community

Problems on Number systems (Level 3)


1. Convert the binary number 101011110111.1011 to decimal.
2. Convert the decimal number 98765 to binary.
3. Convert the decimal number 32768 to hexadecimal.
4. Convert the hexadecimal number 1FEDCBA to decimal.
5. Perform the binary addition: 110110110 + 10101010.
6. Perform the decimal subtraction: 876543 - 98765.
7. Perform the hexadecimal multiplication: ABC * DEF.
8. Convert the binary number 11110000111100001111 to
hexadecimal.
9. Convert the decimal number 999999 to binary.
10. Convert the hexadecimal number DEADBEEF to decimal. 13
Varun Kouda - Silicon Community

Logical gates

Topic 2

14
Varun Kouda - Silicon Community

Truth Tables (1)


1. OR Gate

A B A OR B

0 0 0

0 1 1

1 0 1

1 1 1

15
Varun Kouda - Silicon Community

Truth Tables (2)


1. AND Gate

A B A AND B

0 0 0

0 1 0

1 0 0

1 1 1

16
Varun Kouda - Silicon Community

Truth Tables (3)


1. XOR Gate

A B A XOR B

0 0 0

0 1 1

1 0 1

1 1 0

17
Varun Kouda - Silicon Community

Truth Tables (4)


1. XNOR Gate

A B A XNOR B

0 0 1

0 1 0

1 0 0

1 1 1

18
Varun Kouda - Silicon Community

Truth Tables (5)


1. NAND Gate

A B A NAND B

0 0 1

0 1 1

1 0 1

1 1 0

19
Varun Kouda - Silicon Community

Truth Tables (6)


1. NOR Gate

A B A AND B

0 0 1

0 1 0

1 0 0

1 1 0

20
Varun Kouda - Silicon Community

Practice Problems on Logic gates (1)


1. How can you implement an OR gate using only NAND gates?
2. What is the output of a NOR gate when both inputs are high (1)?
3. How can you implement a NOT gate using only NAND gates?
4. What is the output of an XOR gate when both inputs are high (1)?
5. How can you implement an AND gate using only NOR gates?
6. What is the relationship between an XOR gate and a half adder?
7. How can you implement a 2-input AND gate using only 2-input XOR
gates?
8. What is the output of an XNOR gate when both inputs are high (1)?
9. How can you implement a 3-input OR gate using only 2-input AND and
NOT gates?
10. What is the relationship between a full adder and logic gates?
21
Varun Kouda - Silicon Community

Practice Problems on Logic gates (2)


1. Design a circuit using logic gates that implements the following
Boolean expression: F = (A AND B) OR (C AND (NOT D)).
2. Simplify the following Boolean expression using Boolean algebra
and logic gates: F = (A AND B) OR (A AND (NOT B)).
3. Simplify the following Boolean expression using Boolean algebra
and logic gates: F = (A XOR B) AND ((NOT A) OR (NOT B)).
4. Simplify the following Boolean expression using Boolean algebra
and logic gates: F = (A AND (B OR C)) OR (D AND (NOT B)).

22
Varun Kouda - Silicon Community

Boolean Algebra and K-Maps

Topic 3

23
Varun Kouda - Silicon Community

Boolean Algebra
To describe behavior of combinational circuit. We require
● Truth table
● Boolean algebraic expressions
● Digital logic circuit/diagram
Algebraic expression written according to laws of boolean
algebra specifies not only what a combinational circuit does,
but also how it does it!

24
Varun Kouda - Silicon Community

Boolean Algebra - Fundamental properties

Commutative:
x+y = y+x x.y = y.x
Associative
(x+y)+z = x+(y+z) (x.y).z = x.(y.z)
Distributive
x+(y.z) = (x+y).(x+z) x.(y+z)=(x.y)+(x.z)
Identity
x+0 = x x.1 = x
Complement
25
Varun Kouda - Silicon Community

Boolean Algebra
Boolean algebra has three operations defined over boolean variables: OR
(+), AND (.) and complement (’)
Duality property: each boolean property has a dual property
Exchange + and . Exchange 1 and 0

• Every boolean expression can be transformed to an AND-OR expression


Resulting in a 2 level circuit

26
Varun Kouda - Silicon Community

Boolean Algebra Some useful properties


• Zero theorem
x+1 =1 x.0 = 0
Absorption property
x + x.y = x x.(x+y) = x
De Morgan’s law
(a.b)’ = a’ + b’ (a+b)’ = a’ . b’
(a.b.c)’ = a’+b’+c’ (a+b+c)’= a’.b’.c’
Complement
(x’)’ = x
27
Varun Kouda - Silicon Community

Why K-Map
• Every boolean expression has a corresponding logic circuit diagram; and
every logic circuit diagram has a corresponding boolean expression One to
one correspondence
• But a given truth table can have several corresponding implementations
• How to map from truth table to boolean expression ?
Ø How to pick the “best” boolean expression ?

28
Varun Kouda - Silicon Community

Transformation of Boolean expressions


• abc + a’bc + abc’
= (a +a’)bc + abc’
= bc + abc’
• a’bc + abc + abc’
= a’bc + ab(c + c’)
= a’bc + ab
• a’bc + abc + abc’
= a’bc + abc + abc + abc’
= (a’+a)bc + ab (c+c’)
29
Varun Kouda - Silicon Community

Minterms and K-Maps representation


Concept of “distance” between two minterms (Hamming distance):
Ø Number of variables that are different
Ø Distance(abc, abc’)=1 only c and c’ different
Ø Distance(abc, a’bc’)=2 both a and c are different
Arrange 2-d truth table so that values in consecutive columns(rows)
differ in one bit position
K - Maps with 2 adjacent and 4 adjacent cells
● Group ‘cells’ in K-map that are adjacent and have a value of 1 in the
cell
● Group of 2 cells in 3 variable K-map: is an AND of two variables
● Group of 4 cells in 3 variable K-map: is single variable 30
Varun Kouda - Silicon Community

2D K-Maps

31
Varun Kouda - Silicon Community

4D K-Maps

32
Varun Kouda - Silicon Community

Problems on expressions using properties

Problem 1: Simplify the following Boolean expression using Boolean


algebra properties:

F = (A + B) • (A + C)

Problem 2: Simplify the given Boolean expression using De Morgan's


theorem:

F = A • (B + C)' + (A' • D)

Problem 3: Using Boolean algebra properties, simplify the following


expression:

F = (A • B) + (A' • C) + (A • B • C)
33
Varun Kouda - Silicon Community

Problems on expressions using properties (2)

Problem 4:

Apply the distributive law to simplify the following expression:

F = (A + B) • (C + D) • (E + F)

Problem 5:

Using Boolean algebra identities, simplify the expression:

F = A • (A' + B • C) + B • (A + C) + C • (A' + B)

34
Varun Kouda - Silicon Community

Problems on expressions using properties (3)

Problem 6:Apply the associative law to simplify the following


expression:

F = A • (B • C • D) • E

Problem 7:
Simplify the Boolean expression using Boolean algebra
properties:

F = (A + B') • (A' + B) • (A + B)

35
Varun Kouda - Silicon Community

Problems on expressions using properties (4)


Problem 8:

Using Boolean algebra identities and properties, simplify the expression:

F = (A + B) • (A + B') • (A' + B')

Problem 9:

Apply the distributive law to simplify the following expression:

F = A • (B + C + D) + A • (B + C' + D') + A • (B' + C' + D)

Problem 10:

Simplify the given expression using Boolean algebra properties:

F = (A • B) + (A' • B) + (A • B') + (A' • B') 36


Varun Kouda - Silicon Community

Solve the problems using K-Maps


Problem 1: Consider a 2-variable Karnaugh map. Simplify the following Boolean
expression using the K-map:

F = Σ(0, 1)

Problem 2: Given a 3-variable Karnaugh map, simplify the Boolean expression:

F = Σ(1, 3, 5, 6, 7)

Problem 3: Using a 4-variable Karnaugh map, simplify the following Boolean


expression:

F = Σ(0, 1, 2, 3, 7, 8, 10, 12, 13, 15)

Problem 4: Consider a 3-variable Karnaugh map. Simplify the Boolean expression:

F = Σ(0, 1, 2, 4, 6) 37
Varun Kouda - Silicon Community

Solve the problems using K-Maps (2)


Problem 5: Given a 4-variable Karnaugh map, simplify the following Boolean
expression:

F = Σ(1, 3, 4, 5, 9, 10, 12, 14)

Problem 6: Using a 3-variable Karnaugh map, simplify the Boolean expression:

F = Σ(1, 2, 4, 5, 7)

Problem 7:

Consider a 4-variable Karnaugh map. Simplify the following Boolean expression:

F = Σ(0, 1, 2, 3, 4, 7, 8, 9, 12, 13, 15)

38
Varun Kouda - Silicon Community

Solve the problems using K-Maps (3)


Problem 8: Given a 3-variable Karnaugh map, simplify the Boolean
expression:

F = Σ(0, 2, 3, 5)

Problem 9: Using a 4-variable Karnaugh map, simplify the following


Boolean expression:

F = Σ(1, 2, 3, 4, 5, 6, 10, 11)

Problem 10:

Consider a 2-variable Karnaugh map. Simplify the Boolean expression:

F = Σ(0, 3) 39

You might also like