Podcast
Questions and Answers
Which of the following is NOT a primary component of an ALU?
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.
An ALU can only perform arithmetic operations, not logical operations.
False (B)
What is the purpose of the 'Function Unit' in an ALU?
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.
The ________ in an ALU selects the required output based on the instruction.
What does the Instruction Decoder do within an ALU?
What does the Instruction Decoder do within an ALU?
The instruction given to an ALU is always a decimal number.
The instruction given to an ALU is always a decimal number.
What is the role of the Output Multiplexer in an ALU?
What is the role of the Output Multiplexer in an ALU?
In the context of an ALU, a 'controller' acts like a ________, directing the flow of data based on the instruction.
In the context of an ALU, a 'controller' acts like a ________, directing the flow of data based on the instruction.
Which logic gate is essential for converting an adder into a subtractor using controlled inversion?
Which logic gate is essential for converting an adder into a subtractor using controlled inversion?
A half adder circuit takes three bits as input.
A half adder circuit takes three bits as input.
What are the two output bits of a half adder?
What are the two output bits of a half adder?
The Boolean expression for the 'sum' output of a half adder is ________.
The Boolean expression for the 'sum' output of a half adder is ________.
Match the following functions to their descriptions:
Match the following functions to their descriptions:
How many inputs does a full adder have?
How many inputs does a full adder have?
A full adder can be constructed using a single half adder and an OR gate.
A full adder can be constructed using a single half adder and an OR gate.
In the context of ALU design, what is 'controlled inversion' used for?
In the context of ALU design, what is 'controlled inversion' used for?
When using controlled inversion for subtraction, setting the 'control' input to 1 effectively ________ the input.
When using controlled inversion for subtraction, setting the 'control' input to 1 effectively ________ the input.
In a multi-bit ALU, what happens to the 'carry out' of each ALU?
In a multi-bit ALU, what happens to the 'carry out' of each ALU?
To perform B - A, one would have to consider S = A + (2’s Complement of B).
To perform B - A, one would have to consider S = A + (2’s Complement of B).
Explain how controlled inversion enables a single adder circuit to perform both addition and subtraction.
Explain how controlled inversion enables a single adder circuit to perform both addition and subtraction.
Flashcards
What is an ALU?
What is an ALU?
The component of a CPU that performs arithmetic and logic operations.
What is the Function Unit?
What is the Function Unit?
A part of the ALU containing the logic blocks that carry out operations simultaneously.
What is the Controller?
What is the Controller?
Selects required output based on the instruction.
What is an Instruction Decoder?
What is an Instruction Decoder?
Signup and view all the flashcards
What is an Output Multiplexor?
What is an Output Multiplexor?
Signup and view all the flashcards
What is a Half Adder?
What is a Half Adder?
Signup and view all the flashcards
What is a Full Adder?
What is a Full Adder?
Signup and view all the flashcards
How to perform subtraction?
How to perform subtraction?
Signup and view all the flashcards
What is Controlled Inversion?
What is Controlled Inversion?
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)
- Control = 0 indicates Addition
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.