Question: Using Nand2Tetris HDL, how do you write an 8-bit to 3-bit priority encoder? So far I have: //Priority Encoder //input is 8-bit long array //output

Using Nand2Tetris HDL, how do you write an 8-bit to 3-bit priority encoder?

So far I have:

//Priority Encoder //input is 8-bit long array //output is 3-bit long array

CHIP PriorityEncoder83 { IN a[8]; OUT out[3], idle;

PARTS: //00000000 Or(a=a[0], b=a[1], out=ab); Or(a=a[2], b=a[3], out=bc); Or(a=a[4], b=a[5], out=cd); Or(a=a[6], b=a[7], out=de); Or(a=ab, b=bc, out=ef); Or(a=ef, b=cd, out=fg); Or(a=fg, b=de, out=notIdle); Not(in=notIdle, out=idle);

//00000001 //00000010 And(a=a[1], b=a[1], out=out[0]); //00000100 And(a=a[2], b=a[2], out=out[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 Databases Questions!