Question: Write a simulation functions for AND gate and OR gate, e . g . , int AND _ gate ( int a , int b

Write a simulation functions for AND gate and OR gate, e.g.,
int AND_gate (int a, int b){....}
int OR_gate (int a, int b){....}
2. Write a simulation function for the full_adder. e.g.,
int full_adder (int a, int b, int cin, int &cout){....}
3. Write a simulation function for the 2x1 mux, e.g.,
int mux_2x1(int x1, int x2, int sel){....}
4. Write a simulation function for the 4x1 mux, e.g.,
int mux_4x1(int x1, int x2, int x3, int x4, string sel){....}
5. Write a simulation function for the 1bit_ALU, e.g.,
int ALU_1bit (int a, int b, int B_inv, int cin, string op, int &cout){....}
6. Write a driver module (main function) and test your 1-bit ALU for correctness with all
possible input value combinations (total 32 cases to test).
The driver should display input values and the corresponding output values for each
test case, i.e.,
a b cin Binv op result cout
-------------------------------------------------------------------
00000000
00100000
.....................................8 cases for AND
11100011
000001.......
001001.......
.....................................8 cases for OR
111001.......
000010.......
001010.......
.....................................8 cases for Add
111010.......
000110.......
001110.......
.....................................8 cases for Sub
111110.......

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!