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

ic_overview_session1_number_systems_and_logic_gates

The document provides an overview of a course on RTL design and verification, focusing on number systems, logic gates, and Boolean algebra. It covers various number systems including decimal, binary, octal, and hexadecimal, along with their conversions and arithmetic operations. Additionally, it discusses basic logic gates and Boolean algebra principles essential for digital circuit design.

Uploaded by

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

ic_overview_session1_number_systems_and_logic_gates

The document provides an overview of a course on RTL design and verification, focusing on number systems, logic gates, and Boolean algebra. It covers various number systems including decimal, binary, octal, and hexadecimal, along with their conversions and arithmetic operations. Additionally, it discusses basic logic gates and Boolean algebra principles essential for digital circuit design.

Uploaded by

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

IC OVERVIEW

RTL DESIGN AND VERIFICATION

1
COURSE INTRODUCTION

Khóa Học Thiết Kế Vi Mạch Cơ Bản - Trung Tâm Đào Tạo Thiết Kế Vi Mạch ICTC

2
COURSE INTRODUCTION

SUMMARY

HOMEWORK

QUESTION

SELF-LEARNING

3
Session 1: Number
Systems and Logic 1. Number System

Gates 2. Logic gates

4
Number systems
Fundamental elements

A number system consists of two main elements:


❑Digits: These represent the numerical values within the system. For
example, in the decimal system, the digits range from 0 to 9
❑Base: This is the total number of unique digits (including zero) used
in the system. The base determines the counting or positional value
of each digit. Common bases include 10 (decimal), 2 (binary), 8
(octal), and 16 (hexadecimal).

5
Number systems
Decimal Systems

❑ Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
❑ Base: 10
❑ Example: how to analyze a decimal number:

1534 D = 1.103 + 5.102 + 3.101 + 4.100


3570 D = 3.103 + 5.102 + 7.101 + 0.100
0.315 D = 3.10-1 + 1.10-2 + 5.10-3

6
Number systems
Binary Systems

❑ Binary system is used in computers.


❑ Use 0 and 1 to represent low and high voltage level, respectively.
❑ Each digit is called a “bit” (binary digit).
❑ A sequence of 0s and 1s can be used to encode all types of data for computer processing.
❑ Digits: 0, 1
❑ Base: 2

10101 B = 1.24 + 0.23 + 1.22 + 0.21 + 1.20 = 21 D


11.01 B = 1.21 + 1.20 + 0.2-1 + 1.2-2 = 3.25 D

❑ Value range:
Binary Decimal
0000 0
0001 1
… …
0111 7
… …
1111 15
… …
11…1 (n-bit) 2n-1
7
Number systems
Octal Systems

❑ Using binary system is very long to express a data. Octal digit Binary Decimal
Therefore, we need a number system that can be 0 000 0
shorten the expressing and conversing process.
1 001 1
❑ Digit: 0, 1, 2, 3, 4, 5, 6, 7
❑ Base: 8 2 010 2
3 011 3
505 O = 5.82 + 0.81 + 5.80 = 325 D
4 100 4
123.45 O = 1.82 + 2.81 + 3.80 + 4.8-1 + 5.8-2
5 101 5
6 110 6
7 111 7

8
Number systems
Octal Systems

❑ Convert from binary to octal Octal digit Binary Decimal


0 000 0
1 001 101 011 100 B = 11534 O 1 001 1
1 1 5 3 4 2 010 2
3 011 3
❑ Convert from octal to binary 4 100 4
5 101 5
567 O = 101 110 111 B = 101110111 B 6 110 6
5 6 7 7 111 7

9
Number systems
Hexadecimal Systems

Hex Binary Decimal


❑ Octal system is still long. Then hexadecimal 0 0000 0
number system is created. 1 0001 1
❑ Digit: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F 2 0010 2
❑ Base: 16 3 0011 3
4 0100 4
5 0101 5
5F H = 5.161 + 15.160 = 95 D 6 0110 6
EA0 H = 14.162 + 10.161 + 0.160 = 3744 D 7 0111 7
8 1000 8
9 1001 9
A 1010 10
B 1011 11
C 1100 12
D 1101 13
E 1110 14
F 1111 15 10
Number systems
Hexadecimal Systems

Hex Binary Decimal


0 0000 0
1 0001 1
❑ Convert from binary to hex 2 0010 2
3 0011 3
4 0100 4
101 1101 1010 B = 5DA H 5 0101 5
5 D A 6 0110 6
7 0111 7
❑ Convert from hex to binary 8 1000 8
9 1001 9
A 1010 10
25 H = 0010 0101 B
B 1011 11
2 5 C 1100 12
F05 H = 1111 0000 0101 B D 1101 13
F 0 5 E 1110 14
F 1111 15 11
Number systems
Hexadecimal Systems

Hex Binary Decimal


0 0000 0
Practice: 1 0001 1
❑ Convert 57 H to Binary 2 0010 2

❑ Convert 01 1011 0110 to Hex 3 0011 3


4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
A 1010 10
B 1011 11
C 1100 12
D 1101 13
E 1110 14
F 1111 15 12
Number systems
Binary addition and substraction

Addition Rule: Substraction Rule:


❑0+0=0 ❑0-0=0
❑0+1=1 ❑ 0 - 1 = 1 (borrow 1)
❑1+0=1 ❑1-0=1
❑ 1 + 1 = 0 (carry = 1) ❑1-1=0
❑ Example ❑ Example
1 1 1 1 (carry) 1 1 1 1 (borrow)
1001101 1010101
+ -
1101101 0101110
------------------- -------------------
10111010 0100111

13
Number systems
Binary addition and substraction

Addition rule: Substraction Rule:


❑0+0=0 ❑0-0=0
❑0+1=1 ❑ 0 - 1 = 1 (borrow 1)
❑1+0=1 ❑1-0=1
❑ 1 + 1 = 0 (carry = 1) ❑1-1=0
❑ Practice: ❑ Practice

0101111 11100110
+ -
1101101 00111111
------------------- -------------------

14
Number systems
1’s and 2’s Complement

❑ 1’s complement: 1's complement is a method of representing signed binary


numbers by inverting all the bits of its positive counterpart.
❑ 2’s complement: 2's complement is a method of representing signed binary
numbers where the negative of a number is obtained by inverting all the bits
of its positive counterpart and adding 1 (1’s complement + 1)
❑ Example
11100110
-------------------
0 0 0 1 1 0 0 1 (1’s complement)
+
1
-------------------
0 0 0 1 1 0 1 0 (2’s complement)
15
Number systems
Another way for substraction

In fact, subtraction can be transformed into addition by using the 2’s complement
form of the second operand.
❑ Practice: Let’s do this practice again using the above method and compare the
result

11100110
-
00111111
-------------------

16
LOGIC GATE
TRANSISTOR

❑ Most of semiconductor devices nowadays are made from transistor MOS (metal-
oxide-semiconductor).
❑ There are 2 types of MOS transistor: P type (Positive) and N type (Negative)
❑ Transistor acts as a switch to turn ON or turn OFF a circuit.

Transistor N-type typical usage Transistor P-type typical usage


S is connected to GND (Logic 0) D is connected to VDD (Logic 1)
G = 1 => switch is ON => Transistor is conducting G = 1 => switch is OFF => Transistor is NOT conducting
G = 0 => switch is OFF => Transistor is NOT conducting G = 0 => switch is ON => Transistor is conducting
You should review the fundamental knowledge of MOS transistors from university
courses or reference other VLSI textbooks. 17
LOGIC GATE
BASIC LOGIC GATES

❑ NOT gate (inverter), is a fundamental digital logic gate that performs the
operation of logical negation. The output of a NOT gate is the opposite
(complement) of its input. If the input is high (1), the output is low (0), and vice
versa. Transistor N-type typical usage Transistor P-type typical usage
S is connected to GND (Logic 0) D is connected to VDD (Logic 1)
G = 1 => switch is ON => Transistor is conducting G = 1 => switch is OFF => Transistor is NOT conducting
G = 0 => switch is OFF => Transistor is NOT conducting G = 0 => switch is ON => Transistor is conducting

Truth table

A Q A Q

0 1 Verilog code: Q = !A

Figure: NOT gate from 2 transistors 1 0


18
LOGIC GATE
BASIC LOGIC GATES

❑ A NOR gate is a digital logic gate that performs the logical NOR (NOT-OR)
operation. The output of a NOR gate is high (1) only when both of its inputs are
low (0). If at least one input is high, the output is low (0).
Transistor N-type typical usage Transistor P-type typical usage
S is connected to GND (Logic 0) D is connected to VDD (Logic 1)
G = 1 => switch is ON => Transistor is conducting G = 1 => switch is OFF => Transistor is NOT conducting
G = 0 => switch is OFF => Transistor is NOT conducting G = 0 => switch is ON => Transistor is conducting

Truth table (NOR)


Y A Y A Y
A B Y
B B
0 0 1
0 1 0 NOR gate OR gate
Verilog code: Y = !(A | B) Verilog code: Y = (A | B)
1 0 0
Figure: NOR gate 1 1 0
19
LOGIC GATE
BASIC LOGIC GATES

❑ A NAND gate is a digital logic gate that performs the logical NAND (NOT-AND)
operation. The output of a NAND gate is low (0) only when both of its inputs are
high (1). If at least one input is low, the output is high (1).
Transistor N-type typical usage Transistor P-type typical usage
S is connected to GND (Logic 0) D is connected to VDD (Logic 1)
G = 1 => switch is ON => Transistor is conducting G = 1 => switch is OFF => Transistor is NOT conducting
G = 0 => switch is OFF => Transistor is NOT conducting G = 0 => switch is ON => Transistor is conducting

Y Truth table (NAND)


A Y A Y
A B Y
B B
0 0 1
0 1 1 NAND gate AND gate
Verilog code: Y = !(A & B) Verilog code: Y = (A & B)
1 0 1
Figure: NAND gate 1 1 0
20
LOGIC GATE
BOOLEAN’S ALGEBRA

❑ Boolean algebra is widely used in digital electronics, computer science, and


information theory for designing and analyzing digital circuits and algorithms.
❑ In Boolean algebra, the basic operations include AND, OR, and NOT. These
operations are applied to binary variables.
❑ Basic Boolean operations
1. AND (.): A.B is true (1) only when both A and B are true
2. OR (+): A+B is true (1) when at least one of A or B is true.
3. NOT: A or A’. It produces the opposite value. If A is true, NOT A is false.

21
LOGIC GATE
BOOLEAN’S THEOREMS

❑ Idempotent (bất biến): ❑ Distributive (phân phối):


x+x=x x . (y + z) = (x . y) + (x . z)
x.x= x x + (y . z) = (x + y) . (x + z)
❑ Identity (đồng nhất): ❑ Complement (bù):
x+0=x x + x’ = 1
x.1=x y . y’ = 0
❑ Commutative (giao hoán): ❑ Dominative (thống trị):
x+y=y+x x.0=0
x.y=y.X x+1=1
❑ Associative (kết hợp): ❑ Absortive (hấp thu):
(x + y) + z = x + (y + z) x+x.y= x
(x . y) . z = x . (y . z) x . (x + y) = x

22
LOGIC GATE
BOOLEAN’S THEOREMS

Example: simplified below function

❑ x + x’y ❑ x . (x’ + y) ❑ x.y + x’.z + y.z


= (x + x’) . (x + y) = x.x’ + x.y = x.y + x’.z + y.z.(x+x’)
= 1 . (x + y) = 0 + x.y = x.y + x’.z + y.z.x + y.z.x’
=x+y = x.y = x.y.(1+z) + x’.z.(1+y)
= x.y + x’.z

23
LOGIC GATE
BOOLEAN’S THEOREMS

Practice: simplify below functions

❑ x.(x’+y) + y’.(x+y’) ❑ x.y + x.y.z + x’.y + x.y’.z

❑ x.( y + z.(x.y + x.z)) ❑ (x+y).(x’+z)

24
LOGIC GATE
DE MORGAN’S LAW

❑ De Morgan's laws are a pair of fundamental rules in Boolean algebra. These laws
describe the relationships between logical operations (AND, OR) and their
negations (NOT) when applied to logical expressions. There are two De Morgan's
laws:
A+B=A.B A.B=A+B

First Law Second Law

Note: “+” is OR and “.” is AND


Another expression:
A+B=A.B A.B=A+B

All the logic expressions can be represented by NOT, NOR, NAND gates.
25
LOGIC GATE
DE MORGAN’S LAW

Practice: let’s apply these laws to some logical expressions:

A+B=

A.B=

A . (B + C) =

A + (B . C) =

26
SESSION 1
SUMMARY

SUMMARY:
❑ There are 2 mains elements of the number system: base and digit.
❑ Each number system has different ways of base and digit expression.
❑ There are 4 main number system: binary, decimal, octal, hexadecimal.
❑ Each number system can convert to another systems.
❑ Need to remember the rule to perform binary addition/substraction
❑ Transistor acts as a switch to turn ON or turn OFF a circuit.
❑ NOT, NOR, NAND are basic gates and can be used to express any other elements.
Transistor N-type typical usage Transistor P-type typical usage
S is connected to GND (Logic 0) D is connected to VDD (Logic 1)
G = 1 => switch is ON => Transistor is conducting G = 1 => switch is OFF => Transistor is NOT conducting
G = 0 => switch is OFF => Transistor is NOT conducting G = 0 => switch is ON => Transistor is conducting

27
SESSION 1
HOMEWORK

❑ Homework 1:
Prove the below expressions are equivalent !!!
(1) x’yz’ + x’yz + xy’z’ + xy’z + xyz’ + xyz = (x + y + z).(x + y + z’)
(2) A’ + A.B’ + A.B.C’ = A’ + B’ + C’

❑ Homework 2 (*) (advanced level)


A 2-input XOR gate, or Exclusive OR gate, is a digital logic gate that performs the
exclusive OR operation. The output of an XOR gate is high (1) when the number of true
inputs is odd, and it is low (0) when the number of true inputs is even. based on above
description, write truth table, MOS diagram and logic for XOR gate.

28

You might also like