Simulating the Project
1. Go to the Simulate tab and select Dynamic Simulation.
2. The automatically generated code will be loaded for simulation.
3. Click Run to execute:
- Use the interactive menu to change the input values (x, y) and observe the outputs.
4. Control Signals: Configure the signals (zx, nx, zy, ny, f, no) according to the desired operation. For example:
-
Addition: zx=0, nx=0, zy=0, ny=0, f=1, no=0.
-
Subtraction: zx=0, nx=0, zy=0, ny=1, f=1, no=0 (this configuration inverts the value of y before addition).
-
AND: zx=0, nx=0, zy=0, ny=0, f=0, no=0.
-
OR: zx=0, nx=0, zy=0, ny=0, f=0, no=1 (this configuration inverts the result of an AND to achieve OR).
zx |
nx |
zy |
ny |
f |
no |
SaĆda (out) |
1 |
0 |
1 |
0 |
1 |
0 |
0 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
1 |
0 |
1 |
0 |
-1 |
0 |
0 |
1 |
1 |
0 |
0 |
x |
1 |
1 |
0 |
0 |
0 |
0 |
y |
1 |
0 |
1 |
1 |
1 |
1 |
!x |
1 |
1 |
0 |
1 |
1 |
1 |
!y |
1 |
0 |
1 |
0 |
1 |
1 |
-x |
1 |
1 |
0 |
0 |
1 |
1 |
-y |
1 |
0 |
1 |
1 |
1 |
0 |
x+1 |
1 |
1 |
0 |
1 |
1 |
0 |
y+1 |
1 |
0 |
1 |
1 |
0 |
1 |
x-1 |
1 |
1 |
0 |
1 |
0 |
1 |
y-1 |
0 |
0 |
0 |
0 |
1 |
0 |
x+y |
0 |
1 |
0 |
0 |
1 |
1 |
x-y |
0 |
0 |
0 |
1 |
1 |
1 |
y-x |
0 |
0 |
0 |
0 |
0 |
0 |
x&y |
0 |
1 |
0 |
1 |
0 |
0 |
x|y |
Validate the ALU's behavior for each control configuration.
5. Explore other control signal combinations and analyze the results directly in the simulation panel.
6. Test different input and control combinations:
- Addition: x = 5, y = 3.
- Subtraction: x = 7, y = 2.
- AND: x = 0b1100, y = 0b1010.
- OR: x = 0b1100, y = 0b1010.
Note: If you need to check the detailed logic, click on the corresponding wire to view the signals in real-time.
No Comments