Question: Stretch Activity When performing computational operations it is often useful to be able to exe - cute a sequence of operations, each one using the

Stretch Activity
When performing computational operations it is often useful to be able to exe-
cute a sequence of operations, each one using the output of the previous step as
an input to the next step. For example to OR 3 values X OR Y OR Z you might
first calculate X OR Y and then on the next step apply OR Z to the previous
output (X OR Y ).
For this task adapt the circuit FALL so that it can combine a sequence of
operations defined by different values for f1 and f0 at each step, by enabling
the outputs Ft and Gt of step t to be used (feedback) as the inputs for the next
operation Ct+1 and Dt+1 for step t +1. You should also add a further input
(Load) to the chip which when Load =1 will enable you to load new inputs to
Ct and Dt and when set to 0 sets Ct+1= Ft and Dt+1= Gt. The Load input
will allow you to manually set the values of C and D at the start and during
the sequence if required.
Call this chip FSEQ. You can test this chip using FSEQ.tst but may wish to
create further tests before submission.
You must only use the built-in AND, NAND, OR, NOR, NOT, Mux, DMux,
XOR or DFF chips.
Here is my chip FSEQ: CHIP FSEQ {
IN A, B, C, D, f0, f1, load;
OUT E, F, G, Ft, Gt;
PARTS:
FZero(A=A, B=B, C=C, D=D, F=outF0, G=outG0);
FOne(A=A, B=B, C=C, D=D, F=outF1, G=outG1);
FTwo(A=A, B=B, C=C, D=D, F=outF2, G=outG2);
FThree(A=A, B=B, C=C, D=D, E=outE3, F=outF3, G=outG3);
Mux(a=outE3, b=false, sel=f0, out=EMux1);
Mux(a=EMux1, b=false, sel=f1, out=E);
Mux(a=outF3, b=outF2, sel=f0, out=FMux1);
Mux(a=outF1, b=outF0, sel=f0, out=FMux2);
Mux(a=FMux1, b=FMux2, sel=f1, out=F);
Mux(a=outG3, b=outG2, sel=f0, out=GMux1);
Mux(a=outG1, b=outG0, sel=f0, out=GMux2);
Mux(a=GMux1, b=GMux2, sel=f1, out=G);
DFF(in=nextC, out=currentC);
DFF(in=nextD, out=currentD);
Mux(a=A, b=currentC, sel=load, out=nextC);
Mux(a=B, b=currentD, sel=load, out=nextD);
Mux(a=currentC, b=nextC, sel=load, out=Ft);
Mux(a=currentD, b=nextD, sel=load, out=Gt);
}
However, it is not passing the following test file FSEQ.tst:
load FSEQ.hdl,
output-file FSEQ.out,
compare-to FSEQ.cmp,
output-list f1%B3.1.3 f0%B3.1.3 A%B3.1.3 B%B3.1.3 C%B3.1.3 D%B3.1.3 E%B3.1.3 F%B3.1.3 G%B3.1.3;
set load 1,
set f11,
set f01,
set A 1,
set B 0,
set C 1,
set D 1,
tick,
tock,
output;
set load 0,
set f10,
set f00,
tick,
tock,
output;
set f11,
set f01,
tick,
tock,
output;
Please help me to fix my chip so that it passes this test. You can test the file with the hardware simulator on nand2tetris.com Below is FSEQ.cmp:
| f1| f0| A | B | C | D | E | F | G |
|1|1|1|0|1|1|0|0|0|
|0|0|1|0|1|1|0|1|0|
|1|1|1|0|1|1|0|0|1|

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!