Sei sulla pagina 1di 14

COMPUTER PROGRAMMING I ( (TA C162) )

Lecture 9 Combinational Circuits

Todays Agenda
Demorgans Law Combinational Circuit Examples
Adder
Half Adder Full Adder

Saturday, January 30, 2010

Biju K Raveendran@BITS Pilani.

Demorgans Law
Suppose we complement an input before applying it to a gate gate. For example, consider

Observe, if inputs are 0 and 1 then output is 1. p

Saturday, January 30, 2010

Biju K Raveendran@BITS Pilani.

Demorgans Law -Converting AND to OR


Exercise: How to Convert OR to AND?

A 0 0 1 1

B 0 1 0 1

A 1 1 0 0

B 1 0 1 0

A.B 1 0 0 0

(A.B) 0 1 1 1

Same as A+B
Saturday, January 30, 2010 Biju K Raveendran@BITS Pilani. 4

Demorgans Law g
Observation
(A.B) = A+B

We can prove that


(A+B) = A.B

. represents Logic AND + represents Logic OR


represents Logic NOT
Saturday, January 30, 2010 Biju K Raveendran@BITS Pilani. 5

DeMorgan's Law
First Law A.B.C.D. A B C D . = = A B C D . A+B+C+D+ Second Law A+B+C+D . = = A.B.C.D. . Here . represents Logic AND And + represents Logic OR

Saturday, January 30, 2010

Biju K Raveendran@BITS Pilani.

Logic Structures
2 kinds
Storage Structures
Permits the storage of information (as bits)

Decision Structures D i i St t
Does not include storage of information

Also known as Combinational Logic Structures


Outputs strictly depend on the combination of the current input values p Outputs are not dependent on the past history stored internally (no information can be stored internally i a combinational l i circuit) i t ll in bi ti l logic i it)
Saturday, January 30, 2010 Biju K Raveendran@BITS Pilani. 7

Combinational Logic Structures


Examples
Full Adder Decoder Multiplexer (MUX) Programmable Logic Array

Saturday, January 30, 2010

Biju K Raveendran@BITS Pilani.

Lets Design a Circuit for Binary Addition


Requirement Adds the 2 bits given and produces sum and carry
0 0 0 1 1 0 1 1 (Half) ADDER carry y sum

Before proceeding to attempt drawing circuit p g p g


Understand the input/output of the circuit Define the behavior of the circuit using truth table Write the Sum of Products (SOP) Boolean expressions from the ( ) p truth table We dont bother the simplification process involved in reducing the circuitry complexity for now.

Saturday, January 30, 2010

Biju K Raveendran@BITS Pilani.

Truth Table:
A 0 0 1 1 B 0 1 0 1 0 1 1 0

Adding two bits: Half Adder


Sum Carry 0 0 0 1

Boolean Expressions S = ((NOT A) AND B) OR (A AND (NOT B)) C = A AND B

Limitation: It can add only two bits at a time


10

Adding Three Bits: Full Adder


4-Bit Full Adder

Requirement: Adds the two bits and a carry generated from the previous bit column
Saturday, January 30, 2010 Biju K Raveendran@BITS Pilani. 11

Full Adder
Performs the addition in column i 3 inputs: ai, bi and ci 2 outputs: si and ci+1 ci is the carry in from bit position i-1 ci+1 is the carry out to bit position i+1

ai 0 0 1 1

bi 0 1 0 1

ci+1 0 0 0 1

si 0 1 1 0

a n 1 a n 2 ... a1 a 0 + b n 1 b n 2 ... b1 b0 + c n 1 c n 2 ... c1 0 s n 1 s n 2 ... s1 s 0


Saturday, January 30, 2010 Biju K Raveendran@BITS Pilani. 12

Full Adder: Truth Table


A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 Cin 0 1 0 1 0 1 0 1 S 0 1 1 0 1 0 0 1 Cout 0 0 0 1 0 1 1 1

SOP for Sum S = A.B.C + A.B.C + A.B.C + A.B.C SOP for Carry C = A.B.C + A.B.C + A B C + A B C A B C A B C A.B.C A.B.C
Saturday, January 30, 2010 Biju K Raveendran@BITS Pilani. 13

Full Adder Logic Implementation

Saturday, January 30, 2010

Biju K Raveendran@BITS Pilani.

14

Potrebbero piacerti anche