0% found this document useful (0 votes)
12 views32 pages

Week 02 01

computer system design-3

Uploaded by

AstaBasu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views32 pages

Week 02 01

computer system design-3

Uploaded by

AstaBasu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

Introduction to Computer Systems Design

Ayon Chakraborty
Department of CSE, IIT Madras
The Transformation Hierarchy

Ayon Chakraborty, Department of CSE, IITM CS3031


Building Complex Computer Systems
Module 8-10/IC

PCB ~8/device IC 8-16/PCB


Computer
(Google Pixel XL)

Information:
ON/OFF
Cell 1K-
switching Transistor 2-8/gate Gate 2-16/cell 10K/module

Ayon Chakraborty, Department of CSE, IITM CS3031


Using Voltages “Digitally”
Encode only one bit of information, 2 states: “0” and “1”. Use the same uniform
representation across all components/wires in the digital system.

Interpret as 0 Interpret as 1
V < VTH V ≥ VTH
#1

Volts
VTH
Interpret as 0 “Forbidden” zone Interpret as 1
#2
V ≤ VL VL > V > V H V ≥ VH

Volts
VL VH
Ayon Chakraborty, Department of CSE, IITM CS3031
Binary Digital System
Digital System: Binary (base 2) System:
Finite number of values Uses two states or values

Basic unit of information: the binary 3V “1”


digit, or bit 2.5V
– Two values: 0 and 1

0 and 1 represented by voltages 0.5V

Key advantage: efficient circuits 0V “0”

(cheap, small, fast, low power)

Ayon Chakraborty, Department of CSE, IITM CS3031


Digital Logic Design
Digital Logic → Digital Circuits
Boolean Algebra Key Link Between Logic and Circuits

❑ Despite existence of relays and vacuum tubes


❑ 1854: George Boole shows that logic is in 1906, digital electronics did not emerge for
math, not just philosophy! thirty more years!
❑ Claude Shannon notices similarities between
❑ Boolean algebra: the mathematics of Boolean algebra and electronic telephone
binary values. switches.
❑ Shannon’s 1937 MIT Master’s Thesis
introduces the world to binary digital
electronics.

Ayon Chakraborty, Department of CSE, IITM


Lesson Plan
Module 1 Module 4

Module 2 Module 3
Foundations,
Digital World, Design of Design of Sequential
Logic Gates, Combinational Logic Logic Elements
Boolean Algebra, Elements → ALU → CPU Timing, Control
Computer
Arithmetic Processor Design and Instruction Set Architecture

**Some follow-up concepts related to memory management may be


discussed depending on progress

Ayon Chakraborty, Department of CSE, IITM


Tic-Tac-Toe Game
Assert whether the player with mark ‘X’ has won?
Transformation
AIJ = ‘X’ or ‘O’
AIJ = 1 if it contains ‘X’ Natural language.
= 0 otherwise Can be ambiguous!
A11 A12 A13
Rule: “If all three AIJs are 1 along any
A21 A22 A23 row, column or diagonal, the player ‘X’
wins”
A31 A32 A33

Can we build a hardware circuit that checks the board


configuration and declares the winner? (e.g., glows RED LED if
X wins, glows GREEN LED if O wins)

Ayon Chakraborty, Department of CSE, IITM CS3031


Building Complex Systems
Build logic structures that when suitably combined, evolves into a
microarchitecture of a computing system.

Transistors implementing
logic gates

Input(s) Logic Circuit Output(s)

Functional Specification: Timing Specification:


Relationship between input The delay between inputs
and output variables changing and outputs
responding

Ayon Chakraborty, Department of CSE, IITM CS3031


Building Complex Systems
Functional
Specification
Input(s) Output(s)
Timing
Specification

Combinational Logic
Memoryless
Outputs are strictly dependent on the combination of input values
that are being applied to circuit right now.

Later we will learn: Sequential Logic


Has memory: Structure stores history → Can “store” data values
Outputs are determined by previous (historical) and current values
of inputs

Ayon Chakraborty, Department of CSE, IITM CS3031


Functional Specifications

Functional specification of outputs in terms of inputs

What do we mean by “function”?


❑Uniqueness. Unique mapping from input values to
output values
❑ Unambiguity. The same input values produce the
same output value every time
❑No memory. Does not depend on the history of input
values.

Ayon Chakraborty, Department of CSE, IITM CS3031


Back to Tic-Tac-Toe
Assert whether the player with mark ‘X’ has won?

Transformation
AIJ = ‘X’ or ‘O’
AIJ = 1 if it contains ‘X’ Natural language.
= 0 otherwise Can be ambiguous!
A11 A12 A13
Rule: “If all three AIJs are 1 along any
A21 A22 A23 row, column or diagonal, the player ‘X’
wins”
A31 A32 A33

Can we build a hardware circuit that checks the board


configuration and declares the winner? (e.g., glows RED LED if
X wins, glows GREEN LED if O wins)
Ayon Chakraborty, Department of CSE, IITM CS3031
Truth Table
Functional Specification:
Relationship between input and output variables

Size of the table?


AIJ = ‘1’ or ‘0’ A11 A12 A13 A21 A22 A23 A31 A32 A33 W
1 1 1 0 1 0 0 0 0 1
A11 A12 A13 1 0 1 0 0 1 0 1 0 0

A21 A22 A23


… … … ….
A31 A32 A33

Can we make it concise or easier to Size grows exponentially


express/communicate? with number of variables!

Ayon Chakraborty, Department of CSE, IITM CS3031


Boolean Algebra

Ayon Chakraborty, Department of CSE, IITM CS3031


Simple Equations: NOT / AND / OR

A (reads “not A”) is 1 iff A is 0


A 𝑨

A • B (reads “A and B”) is 1 iff A and B are both 1

A
A• B
B

A + B (reads “A or B”) is 1 iff either A or B is 1


A
A+B
B

Ayon Chakraborty, Department of CSE, IITM CS3031


Boolean Algebra: Big Picture
◼ An algebra on 1’s and 0’s
❑ with AND, OR, NOT operations

◼ What you start with


❑ Axioms: basic things about objects and operations

you just assume to be true at the start


◼ What you derive first
❑ Laws and theorems: allow you to manipulate Boolean

expressions
❑ Allow us to do some simplification on Boolean expressions

◼ What you derive later


❑ More “sophisticated” properties useful for manipulating digital

designs represented in the form of Boolean equations

Ayon Chakraborty, Department of CSE, IITM CS3031


Boolean Algebra: Axioms
Formal version English version
1. B contains at least two elements,
0 and 1, such that 0 ≠ 1 Math formality...

2. Closure a,b ∈ B,
(i) a + b ∈ B Result of AND, OR
(ii) a • b ∈ B stays in set you
start with
3. Commutative Laws: a,b ∈ B, For primitive AND, OR of
(i) a + b = b + a
(ii) a • b = b • a 2 inputs, order doesn’t matter

4. Identities: 0, 1 ∈ B There are identity elements


(i) a + 0 = a for AND, OR, that give you back
(ii)a • 1 = a what you started with

5. Distributive Laws:
(i) a + (b • c) = (a + b) • (a + c) • distributes over +, just like algebra
(ii) a • (b + c) = a • b + a • c … but + distributes over •, also

6. Complement:
(i) a + 𝑎=ത 1 There is a complement element;
(ii) 𝐚 • 𝒂 = 0 AND/ORing with it gives the
identity elm.

Ayon Chakraborty, Department of CSE, IITM CS3031


Boolean Algebra: Axiom Duality
◼ Observation
❑ All the axioms come in “dual” form

❑ Anything true for an expression also true for its dual

❑ So any derivation you could make that is true, can be flipped into

dual form, and it stays true


◼ Duality — More formally
❑ A dual of a Boolean expression is derived by replacing

◼ Every AND operation with... an OR operation

◼ Every OR operation with... an AND

◼ Every constant 1 wit h... a constant 0 a • (b + c) = (a • b) + (a • c)


Example
◼ Every constant 0 wit h... a constant 1➙ a + (b • c) = (a + b) • (a + c)

◼ But don’t change any of the literals or play with the


complements!

Ayon Chakraborty, Department of CSE, IITM CS3031


Boolean Algebra: Axiom Duality
Dual
Operations with 0 and 1: AND, OR with identities
1. X + 0 = X 1D. X • 1 = X gives you back the original
2. X + 1 = 1 2D. X • 0 = 0 variable or the identity

Idempotent Law:
3. X + X = X 3D. X • X = X AND, OR with self = self

Involution Law:
double complement =
ഥ) = X
4. (𝑿 no complement

Laws of Complementarity: AND, OR with complement


ഥ= 1
5. X + 𝐗 ഥ= 0
5D. X • 𝐗 gives you an identity

Commutative Law:
6. X + Y = Y + X 6D. X • Y = Y • X Just an axiom…

Ayon Chakraborty, Department of CSE, IITM CS3031


Boolean Algebra: Axiom Duality
Associative Laws:
7. (X + Y) + Z = X + (Y + Z) 7D. (X • Y) • Z = X • (Y • Z) Parenthesis order
=X+Y+Z =X•Y•Z does not matter

Distributive Laws:
8. X • (Y+ Z) = (X • Y) + (X • Z) 8D. X + (Y• Z) = (X + Y) • (X + Z) Axiom

Simplification Theorems:
ഥ= X
9. X • Y + X • 𝒀 ഥ) = X
9D. (X + Y) • (X +𝒀
Useful for
10. X + X • Y = X 10D. X • (X + Y) = X simplifying
ഥ) • Y = X • Y
11. (X + 𝒀 ഥ) + Y = X + Y
11D. (X •𝒀 expressions

Ayon Chakraborty, Department of CSE, IITM CS3031


CS2300
Boolean Algebra: Proving
Proving theorems via axioms of Boolean Algebra:

ഥ= X
EX: Prove the theorem: X • Y + X • 𝒀
ത) =X
X • ( Y +𝐘 Distributive (5)
X•1 =X Complement (6)
X =X Identity (4)

EX2: Prove the theorem: X + X•Y = X


X•1+X•Y =X Identity (4)

X•(1+Y) =X Distributive (5)

X•1 =X Identity (2)

X =X Identity (4)

Ayon Chakraborty, Department of CSE, IITM CS3031


DeMorgan’s Laws
DeMorgan's Law:
12. (𝑿 + 𝒀 + 𝒁 + ⋯ ) = 𝑿 ഥ. 𝒀
ഥ. 𝒁
ഥ. …
ഥ +𝒀
12D. (𝑿 . 𝒀. 𝒁. … ) = 𝑿 ഥ+𝒁 ഥ+ …

 Think of this as a transformation


▪ Let’s say we have:

F=A+B+C

▪ Applying DeMorgan’s Law (12), gives us


ഥ. 𝑩
𝑭 = (𝑨 + 𝑩 + 𝑪) = (𝑨 ഥ)
ഥ. 𝑪

At least one of A, B, C is TRUE --> It is not the case that A, B, C are all false

Ayon Chakraborty, Department of CSE, IITM CS3031


DeMorgan’s Laws (contd.)
These are conversions between different types of logic functions
They can prove useful if you do not have every type of gate

ഥ𝒀
𝑨 = (𝑿 + 𝒀) = 𝑿 ഥ 𝑿
𝒀 𝑨

NOR is equivalent to AND 𝑿


with inputs complemented 𝒀
𝑨

𝑿
𝑩
ഥ+𝒀
ഥ 𝒀
𝑩 = (𝑿𝒀) = 𝑿

𝑿
𝑩
𝒀
NAND is equivalent to OR
with inputs complemented

Ayon Chakraborty, Department of CSE, IITM CS3031


Boolean Algebra → Logic Circuits
Recall the Transformation Hierarchy

Computational Problem
Higher Levels of Abstraction

Algorithms
Common CL Blocks
Programming Languages
System Software (Compilers/OS)
Minimizing CL Circuits
HW/SW Interface (Firmware, Drivers)
Micro-Architecture Combinational Logic (CL)

Logic Circuits
Boolean Algebra Logic Gates
Devices

Electrons
Transistors, CMOS Logic

Ayon Chakraborty, Department of CSE, IITM CS3031


Sum of Products
❑ Assume we have the truth table of a Boolean Function

❑ How do we express the function in terms of the inputs in a


standard manner?

❑ Idea: Sum of Products form


❑ Express the truth table as a two-level Boolean expression
❑ that contains all input variable combinations that result

in a 1 output
❑ If ANY of the combinations of input variables that results
in a 1 is TRUE, then the output is 1
❑ F = OR of all input variable combinations that result in a 1

Ayon Chakraborty, Department of CSE, IITM CS3031


Some Definitions
■ Complement: variable with a bar over it
𝑨,𝑩,𝑪

■ Literal: variable or its complement


𝑨,𝑨,𝑩,𝑩,𝑪,𝑪

■ Implicant: product (AND) of literals


(𝑨 ∙ 𝑩 ∙ 𝑪) , (𝑨 ∙ 𝑪) , (𝑩 ∙ 𝑪)

■ Minterm: product (AND) that includes all input variables


(𝑨 ∙ 𝑩 ∙ 𝑪) , (𝑨 ∙ 𝑩 ∙ 𝑪) , (𝑨 ∙ 𝑩 ∙ 𝑪)

■ Maxterm: sum (OR) that includes all input variables


(𝑨 + 𝑩 + 𝑪) , (𝑨 + 𝑩 + 𝑪) , (𝑨 + 𝑩 + 𝑪)

Ayon Chakraborty, Department of CSE, IITM CS3031


Operator Precedence

ഥ + Y•Z mean?
What does 𝑊• 𝑿

Operator precedence rules


1. NOT (highest priority)
2. AND
3. OR (lowest)

Ayon Chakraborty, Department of CSE, IITM CS3031


Canonical (Standard) Forms

• Truth table is the unique signature of a Boolean function …


• But, it is an expensive representation (recall the TicTacToe
example)

• A Boolean function can have many alternative Boolean expressions


• i.e., many alternative Boolean expressions (and gate realizations)
may have the same truth table (and function)

• Canonical form: standard form for a Boolean expression


• Provides a unique algebraic signature
• If they all say the same thing, why do we care?
• Different Boolean expressions lead to different gate
realizations

Ayon Chakraborty, Department of CSE, IITM CS3031


Two Level Canonical Form
Sum of Products Form (SOP)
Also known as disjunctive normal form or minterm expansion
𝐀 𝐁 𝐂 𝐅 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1
0 0 0 0 ഥ 𝐁𝐂 + 𝐀𝑩
𝑭=𝑨 ഥ𝑪ഥ + 𝐀𝑩 ഥ + 𝐀𝐁𝐂
ഥ 𝐂 + 𝐀𝐁𝑪
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1

• Each row in a truth • A minterm is a product • Each minterm is TRUE for


table has a minterm (AND) of literals that row (and only that row)
All Boolean equations can be written in SOP form
Find all the input combinations (minterms) for which the output of the function is TRUE.

Ayon Chakraborty, Department of CSE, IITM CS3031


SOP Form: Why does it work?
This input
𝐀 𝐁 𝐂 𝐅 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1
0 0 0 0 ഥ 𝐁𝐂 + 𝐀𝑩
𝑭=𝑨 ഥ𝑪ഥ + 𝐀𝑩 ഥ + 𝐀𝐁𝐂
ഥ 𝐂 + 𝐀𝐁𝑪
0 0 1 0
0 1 0 0 Activates
this term
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1

◼ Only the shaded product term — 𝐀𝑩 ഥ ∙ 𝟏 — will be 1


ഥ𝐂 = 𝟏 ∙ 𝟎
◼ No other product terms will “turn on” — they will all be 0
◼ So if inputs A B C correspond to a product term in expression,
❑ We get 0 + 0 + … + 1 + … + 0 + 0 = 1 for output

◼ If inputs A B C do not correspond to any product term in expression


❑ We get 0 + 0 + … + 0 = 0 for output

Ayon Chakraborty, Department of CSE, IITM CS3031

You might also like