You will be creating an Adder/Subtractor, which can toggle between which of the two operations it is doing.  Consider the fact that you have an existing component which can do 4-bit addition, and suppose that you want to be able to do A - B for some numbers A and B. Using what you’ve learned about Two’s Complement, you should know that A-B is the same as A + (-B).In Two’s complement, -B is the result of inverting B, and adding 1. In order to invert B, you can’t just use NOT gates, because you need to be able to turn on/off the inversion(since you want to use the same circuit for both addition and subtraction). In order to be able to toggle between inverting B(while subtracting) and using B as it is (while adding), you will need a component that works like the table below: INV A Q 0 0 0 0 1 1 1 0 1 1 1 0 When INV is 0, then Q just outputs whatever A is and when INV is 1, then Q outputs NOT A, which you should be able to see from the table. This table should be familiar to you as it exactly looks like the table for an XOR gate. As a result, if you pass in one of your inputs(B) as one of the inputs to an XOR gate, and use the other to control whether or not you are inverting, you can toggle whether you are adding or subtracting.  In order to do the extra +1 for Two’s complement, you can just set Cin to 1. Otherwise, it should just be 0 by default, because you don’t want to carry anything into the adder when adding. Ultimately, your circuit should perform A + B when the SUB input is 0, and A + ~B + 1, with ~B being the inverse of B, and the +1 coming from Cin.

Introductory Circuit Analysis (13th Edition)
13th Edition
ISBN:9780133923605
Author:Robert L. Boylestad
Publisher:Robert L. Boylestad
Chapter1: Introduction
Section: Chapter Questions
Problem 1P: Visit your local library (at school or home) and describe the extent to which it provides literature...
icon
Related questions
Question

You will be creating an Adder/Subtractor, which can toggle between which of the two operations it is doing. 

Consider the fact that you have an existing component which can do 4-bit addition, and suppose that you want to be able to do A - B for some numbers A and B. Using what you’ve learned about Two’s Complement, you should know that A-B is the same as A + (-B).In Two’s complement, -B is the result of inverting B, and adding 1. In order to invert B, you can’t just use NOT gates, because you need to be able to turn on/off the inversion(since you want to use the same circuit for both addition and subtraction). In order to be able to toggle between inverting B(while subtracting) and using B as it is (while adding), you will need a component that works like the table below:

INV

A

Q

0

0

0

0

1

1

1

0

1

1

1

0

When INV is 0, then Q just outputs whatever A is and when INV is 1, then Q outputs NOT A, which you should be able to see from the table. This table should be familiar to you as it exactly looks like the table for an XOR gate. As a result, if you pass in one of your inputs(B) as one of the inputs to an XOR gate, and use the other to control whether or not you are inverting, you can toggle whether you are adding or subtracting. 

In order to do the extra +1 for Two’s complement, you can just set Cin to 1. Otherwise, it should just be 0 by default, because you don’t want to carry anything into the adder when adding. Ultimately, your circuit should perform A + B when the SUB input is 0, and A + ~B + 1, with ~B being the inverse of B, and the +1 coming from Cin. 

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Logic Gate and Its Application
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, electrical-engineering and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Introductory Circuit Analysis (13th Edition)
Introductory Circuit Analysis (13th Edition)
Electrical Engineering
ISBN:
9780133923605
Author:
Robert L. Boylestad
Publisher:
PEARSON
Delmar's Standard Textbook Of Electricity
Delmar's Standard Textbook Of Electricity
Electrical Engineering
ISBN:
9781337900348
Author:
Stephen L. Herman
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Electrical Engineering
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education
Fundamentals of Electric Circuits
Fundamentals of Electric Circuits
Electrical Engineering
ISBN:
9780078028229
Author:
Charles K Alexander, Matthew Sadiku
Publisher:
McGraw-Hill Education
Electric Circuits. (11th Edition)
Electric Circuits. (11th Edition)
Electrical Engineering
ISBN:
9780134746968
Author:
James W. Nilsson, Susan Riedel
Publisher:
PEARSON
Engineering Electromagnetics
Engineering Electromagnetics
Electrical Engineering
ISBN:
9780078028151
Author:
Hayt, William H. (william Hart), Jr, BUCK, John A.
Publisher:
Mcgraw-hill Education,