Lecture 15 combinational circuits
This presentation is the property of its rightful owner.
Sponsored Links
1 / 27

Lecture 15: Combinational Circuits PowerPoint PPT Presentation


  • 104 Views
  • Uploaded on
  • Presentation posted in: General

Lecture 15: Combinational Circuits. Complete logic functions Some combinational logic functions Half adders Adders Multiplexers Decoders Parity generators Signal propagation in combinational logic ALUs. Announcement. ACM Movie Night 2:00 pm Saturday, Nov 12 Just show up – it’s free!

Download Presentation

Lecture 15: Combinational Circuits

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Lecture 15 combinational circuits

Lecture 15: Combinational Circuits

  • Complete logic functions

  • Some combinational logic functions

    • Half adders

    • Adders

    • Multiplexers

    • Decoders

    • Parity generators

  • Signal propagation in combinational logic

  • ALUs

L15: Combinational Circuits


Announcement

Announcement

  • ACM Movie Night

  • 2:00 pm

  • Saturday, Nov 12

  • Just show up – it’s free!

  • Free Food if you RSVP!

  • Send rsvp to "[email protected]"

  • ACM events are open to all cis and pre-cis students

L15: Combinational Circuits


Complete logic functions

Complete Logic Functions

  • A logic gate is considered to be a complete logic function if we can use just that one type of gate to implement any logic function (i.e., NOT, AND, OR, NAND, and NOR)

  • NAND and NOR functions (each by themselves) are complete logic functions

  • Why would you be interested in complete logic functions or using just one type of logic gate in your design?

L15: Combinational Circuits


Nand represents a complete logic function

NAND Represents a Complete Logic Function

A

NOT

AND

NAND

A

B

A

B

L15: Combinational Circuits


Nand represents a complete logic function cont

NAND Represents a Complete Logic Function (cont.)

OR

A

B

NOR

A

B

L15: Combinational Circuits


Example

Example

  • A’ + B’ + C

  • Circuit design using NOTs and ORs

  • “Brute force” substitution of NAND gates

  • We can make it a little simpler - how about applying DeMorgan’s Law first?

    A’ + B’ = (AB)’

L15: Combinational Circuits


Another example

Another Example

  • AB + B’C

A

B

C

L15: Combinational Circuits


Combinational logic and digital devices

Combinational Logic and Digital Devices

  • Now that we’ve learned how to implement a logic expression in a logic-gate-level design, we can start putting those functions together to form more complex (and useful!) functions

  • Digital logic that is designed so that the outputs are dependent only upon the current set of inputs is called COMBINATIONAL LOGIC

L15: Combinational Circuits


Examples of combinational digital logic functions

Examples of Combinational Digital Logic Functions

  • Multiplexers

  • Decoders

  • Parity Generators

  • Adders

    • Half adders

    • Full adders

    • 32-bit adders

  • Shifters

  • Comparators

  • Arithmetic Logic Units

L15: Combinational Circuits


Half adder

Half Adder

  • Consists of:

    • 2 inputs

    • 2outputs

      • Sum

      • Carry

  • Used for basic integer addition ( 1 bit)

Input

A

Input

B

Sum

Carry

0

0

0

0

0

1

1

0

1

0

1

0

1

1

0

1

L15: Combinational Circuits


Half adder logic design

Half Adder Logic Design

A

Sum

B

Carry

L15: Combinational Circuits


Full adder

Full Adder

Input

A

Carry

In

Input

B

Carry

Out

Sum

  • Consists of:

    • 3 inputs

      • A

      • B

      • Carry in

    • 2outputs

      • Sum

      • Carry out

  • Typical application: link together multiple full adders to add integers containing more than one bit

0

0

0

0

0

0

0

1

1

0

0

1

0

1

0

0

1

1

0

1

1

0

0

1

0

1

0

1

0

1

1

1

0

0

1

1

1

1

1

1

L15: Combinational Circuits


Full adder logic design

Full Adder Logic Design

Carry In

A

Sum

B

Carry Out

L15: Combinational Circuits


Integer addition using full adder circuits

Integer Addition Using Full Adder Circuits

A1

A0

B1

B0

Full

Adder

Full

Adder

Carry Out

Carry In

Carry Out

Carry In

“0”

Sum1

Sum0

Adding two binary numbers, each containing two bits

C1 C0

A(A1,A0)

+B(B1,B0)

_____________

Sum(C1,S1,S0)

L15: Combinational Circuits


Longer chains of adders add longer integers

Longer Chains of Adders Add Longer Integers

A2

B2

A3

A0

B3

B0

A1

B1

Full

Adder

Full

Adder

Full

Adder

Full

Adder

Carry

Carry

Carry

Carry

Carry

“0”

Sum2

Sum3

Sum0

Sum1

L15: Combinational Circuits


Multiplexers

Multiplexers

4 input multiplexer

D0

  • Consist of:

    • 2n data inputs

    • One output

    • n control inputs

  • Used to control the selection of a single output from n different inputs

  • Typical application: parallel to serial converter

D1

Out

D2

D3

A

B

L15: Combinational Circuits


Decoders

Decoders

2 to 4 decoder

D0

A

  • Consist of:

    • n inputs

    • 2n outputs

  • Used to select a single (one) output line

  • Typical application: selecting a memory chip

D1

B

D2

D3

L15: Combinational Circuits


Parity generator

Parity Generator

Even parity for

4 inputs

  • Consist of:

    • n inputs

    • 1output

  • Used to create a parity bit for a given set of inputs

A

B

Output

C

D

L15: Combinational Circuits


Arithmetic logic units alus

Arithmetic Logic Units (ALUs)

  • The ALU is the math engine for modern digital computers

L15: Combinational Circuits


A very simple alu

A Very Simple ALU

  • Performs four functions:

    A .AND. B (A & B) //bitwise AND

    A .OR. B (A | B) //bitwise OR

    NOT.B (~ B) //bitwise NOT

    A + B (A + B) //addition operator

  • Operates on single bits “A” and “B”

L15: Combinational Circuits


Block diagram for a very simple 1 bit alu

Block Diagram for a Very Simple, 1-Bit ALU

Carry In

Inv A

A

Logic Unit

(AND, OR,

NOT)

Output

A

Enable A

B

B

Enable B

Sum

A

Full Adder

B

En OR

2 to 4

Decoder

F1

En AND

En NOT

F0

En ADD

L15: Combinational Circuits

Carry Out


1 bit slice alu example

1-Bit Slice ALU Example

  • Four Functions (AND, OR, NOT B, ADDITION) for single bits Ai and Bi

  • Inputs

    • INV A Inverse of Ai

    • AThe single bit Ai

    • ENAEnable the A input

    • BThe single bit Bi

    • ENBEnable the B input

    • FOControl signal 0

    • F1Control signal 1

    • Carry InCarry-in signal (usually the carry out signal

      from the previous state)

  • Outputs

    • OutputResult of ALU computation

    • Carry OutCarry out signal from full adder circuit

L15: Combinational Circuits


Control signals f0 and f1

Control Signals F0 and F1

  • What do the control signals F0 and F1 do?

  • Both signals go into the 2 to 4 decoder

  • Between the two signals, one of the four ALU functions is selected to be the ALU’s output

Output

Function

F0

F1

A AND B

0

0

0

1

A OR B

1

0

NOT B

1

1

A + B

L15: Combinational Circuits


Putting together digital logic functions connect n 1 bit alus to create 1 n bit alu

Putting together digital logic functionsConnect “n” 1-bit ALUs to create 1 n-bit ALU

An-1

A0

Bn-1

B0

A1

B1

An-2

Bn-2

1-bit

ALU

slice

1-bit

ALU

slice

1-bit

ALU

slice

1-bit

ALU

slice

Outputn-1

Output0

Output1

Outputn-2

Carry outn-2

L15: Combinational Circuits


More complex alus

More Complex ALUs

  • ALUs in modern CPUs can include more functions than the four we just put together

  • For example, other functions that might be useful:

    • multiply

    • shift

    • compare

L15: Combinational Circuits


How would you get the alu to subtract two integers

How would you get the ALU to subtract two integers?

  • A – B

  • Think about the two’s complement procedure

    • NOT B (take the complement of B)

    • NOTB + 1 (add one to the result of step 1)

    • (NOTB + 1) + A (add A to the result of step 2)

    • Ignore any carry out signals

L15: Combinational Circuits


What additional function would we need to be able to multiply and divide integers

What additional function would we need to be able to multiply and divide integers?

  • Shifters (left shift and right shift)

  • Multiplication and division can be thought of as “shift and add” or “shift and subtract” procedures

    We don’t have time to build a multiplier, but this should give you the intuition for how it could be done.

L15: Combinational Circuits


  • Login