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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started