Arithmetic Logic Units (ALU)

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

Questions and Answers

Which of the following is NOT a primary component of an ALU?

  • Function Unit
  • Instruction Decoder
  • Output Multiplexer
  • Memory Controller (correct)

An ALU can only perform arithmetic operations, not logical operations.

False (B)

What is the purpose of the 'Function Unit' in an ALU?

perform logic operations

The ________ in an ALU selects the required output based on the instruction.

<p>controller</p> Signup and view all the answers

What does the Instruction Decoder do within an ALU?

<p>Translates the instruction into control signals. (C)</p> Signup and view all the answers

The instruction given to an ALU is always a decimal number.

<p>False (B)</p> Signup and view all the answers

What is the role of the Output Multiplexer in an ALU?

<p>selects the output</p> Signup and view all the answers

In the context of an ALU, a 'controller' acts like a ________, directing the flow of data based on the instruction.

<p>switch</p> Signup and view all the answers

Which logic gate is essential for converting an adder into a subtractor using controlled inversion?

<p>XOR (D)</p> Signup and view all the answers

A half adder circuit takes three bits as input.

<p>False (B)</p> Signup and view all the answers

What are the two output bits of a half adder?

<p>sum and carry</p> Signup and view all the answers

The Boolean expression for the 'sum' output of a half adder is ________.

<p>x'y+xy'</p> Signup and view all the answers

Match the following functions to their descriptions:

<p>Function Unit = Contains the logic blocks for arithmetic and logic operations. Instruction Decoder = Translates instructions into control signals. Output Multiplexer = Selects the final output of the ALU. Controller = Selects required output.</p> Signup and view all the answers

How many inputs does a full adder have?

<p>3 (A)</p> Signup and view all the answers

A full adder can be constructed using a single half adder and an OR gate.

<p>False (B)</p> Signup and view all the answers

In the context of ALU design, what is 'controlled inversion' used for?

<p>subtraction</p> Signup and view all the answers

When using controlled inversion for subtraction, setting the 'control' input to 1 effectively ________ the input.

<p>inverts</p> Signup and view all the answers

In a multi-bit ALU, what happens to the 'carry out' of each ALU?

<p>It is used as input for the next ALU. (B)</p> Signup and view all the answers

To perform B - A, one would have to consider S = A + (2’s Complement of B).

<p>False (B)</p> Signup and view all the answers

Explain how controlled inversion enables a single adder circuit to perform both addition and subtraction.

<p>inverting one of the inputs</p> Signup and view all the answers

Flashcards

What is an ALU?

The component of a CPU that performs arithmetic and logic operations.

What is the Function Unit?

A part of the ALU containing the logic blocks that carry out operations simultaneously.

What is the Controller?

Selects required output based on the instruction.

What is an Instruction Decoder?

A circuit that converts binary instruction into control signals.

Signup and view all the flashcards

What is an Output Multiplexor?

Selects one of multiple inputs as a single output based on control signals.

Signup and view all the flashcards

What is a Half Adder?

A basic digital circuit that adds two single bits and produces a sum and a carry bit.

Signup and view all the flashcards

What is a Full Adder?

A digital circuit that adds three input bits (two operands and a carry-in) and outputs a sum and a carry-out bit.

Signup and view all the flashcards

How to perform subtraction?

Adding A to the 2's complement of B.

Signup and view all the flashcards

What is Controlled Inversion?

A technique to use the same circuit for both addition and subtraction by selectively inverting one of the inputs.

Signup and view all the flashcards

Study Notes

  • Lecture 4 covers Arithmetic Logic Units (ALU)

Topics

  • ALU Overview
  • Function Unit
  • Instruction Decoder
  • Output Multiplexor
  • Adders and Subtractors

What is an ALU?

  • An ALU performs arithmetic and logic operations
  • It is multi operational and combinational logic circuit
  • It uses selection lines to choose the operation performed

Arithmetic Logic Unit Diagram

  • For example, with Value 1 = 4 and Value 2 = 5, an ALU performs the ADD operation and produces a Result = 9

The ALU Components

  • Function unit: Contains logic blocks to carry out each operation simultaneously
  • Controller: Selects the required output based on the instruction
  • Instruction: A binary 'word' that tells the ALU what to do
  • Switch: Obeys the controller signals and connects the output to the required function

ALU Arithmetic and Logic Functions

  • Output examples include:
    • AND
    • OR
    • NOT
    • XOR
    • Addition
    • Subtraction
  • Instruction Decoder
    • Instruction decoder functions as a combinatorial logic circuit (CLC)
    • CLC circuits depend only on current inputs for their outputs at any given time
    • Converts 'n' input lines to a maximum of 2n output lines
  • Multiple output lines can be chosen via ctrl1 to ctrl4
  • Only one output line is active ('on') for each instruction
  • 'n' instruction lines equal 2n control lines, impacting decoder size, where decoder size is n * 2n
  • Output Multiplexor
    • Collections of AND gates connect to an OR gate, creating a multiplexer logic circuit
    • Functions on a many-to-one principle
    • Selects outputs using decoder outputs

Half Adder (HA)

  • Two-bit adder circuit, adding two single binary digits
  • Has 2 inputs (x and y) and 2 outputs (sum and carry)

Boolean Expressions for Half Adder

  • Sum(s) = x'y + xy' = (x XOR y)
  • Carry(c) = xy

Full Adder (FA)

  • Three-bit adder circuit i.e. 3 inputs (x, y, and carry-in), and 2 outputs (sum and carry)
  • Constructed using two Half Adders and an OR gate

ALU Components

  • Adders and Subtractors
  • Full Adder Circuit: Generates sum and carry outputs

Multi Bit ALU

  • Connects multiple single-bit ALUs together
  • The 'carry out' of each ALU links to the 'carry in' of the next ALU

Subtraction

  • Performed by adding A to the 2's complement form of B
  • S = A + (2's Complement of B) which expands to A + (B' + 1)
  • Convert B to -B in 2's complement by inverting each bit and adding 1

Add / Subtract Circuit

  • Addition and subtraction circuits combine by using Controlled Inversion
  • A control input manages circuit behavior to add or subtract.

Controlled Inversion Truth Table

  • Input Control is the CONTROL, and Input B is the Data
  • With Input Control is 0, then Output F equates to Input B; where applicable the Output is referred to as "Output F=B"
  • With Input Control is 1, then Output F equates to NOT Input B; where applicable the Output is referred to as "Output F=B'"

Controlled Inversion

  • When Control = 0, then F = B
  • When Control = 1, then F = B
  • Truth table matches XOR

Circuit for Add / Subtract Unit

  • When Input Control is 0, then Output F = B
  • When Input Control is 1, then Output F = B' (NOT B)

Control of the Add / Subtract Unit

  • The Control input determines the operation
    • Control = 0 indicates Addition
      • Carry-in is 0
      • Output is A plus B plus 0
    • Control = 1 indicates Subtraction
      • Carry-in is 1
      • Output is A plus (inverse of B plus 1), or A plus (-B)

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

More Like This

Use Quizgecko on...
Browser
Browser