1. [20 pts] One of the most common things to do in C++ programming is to test two variables (or a variable and a constan

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

1. [20 pts] One of the most common things to do in C++ programming is to test two variables (or a variable and a constan

Post by answerhappygod »

1 20 Pts One Of The Most Common Things To Do In C Programming Is To Test Two Variables Or A Variable And A Constan 1
1 20 Pts One Of The Most Common Things To Do In C Programming Is To Test Two Variables Or A Variable And A Constan 1 (106.84 KiB) Viewed 55 times
1. [20 pts] One of the most common things to do in C++ programming is to test two variables (or a variable and a constant) to see if their values are the same. A circuit that tests two binary bit patterns to see if they are identical or not is called a comparator: it outputs a 1 if the inputs are identical, and 0 if they are not. How could we design such a circuit? One of the best things to do when faced with a complex problem is to consider the simplest example of such a problem and solve that first; then try to construct a general solution from your small solution (this is called "divide and conquer"). The simplest example of a comparator is one that takes two bits as input and returns a 1 if they are the same, and 0 otherwise, that is, it has the following truth table. A) [8 pts] Draw the truth table for this one-bit comparator. A B Out B) [4 pts] Draw the logic diagram for this one-bit comparator. Please note that a one-bit comparator is a combinational circuit, which has two inputs (i.e., A and B) and one output (i.e., Out). C) [8 pts] Now that we have divided, let's conquer: if we want to construct a four-bit (half byte) comparator, we need to check if the first bits are the same, and the second are the same, and the third, and the fourth. Please draw the logic diagram for this four-bit comparator. Hint: please do NOT draw a truth table with 8 inputs (i.e., Ao - Az & Bo - B3). Instead, this four-bit comparator circuit should be built based on the one-bit comparator that you just obtain.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply