4 Way 16 Bit MUX Problem

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

4 Way 16 Bit MUX Problem

bickinator
I just completed the 4 Way, 16 Bit Mux gate using 3 gates. However, the way I thought it should work did not work, so I switched a couple of things it worked. But I cannot figure out why. I was wondering if there was somebody to whom I could message / email my code and have them look it over and possibly explain it to me.
Reply | Threaded
Open this post in threaded view
|

Re: 4 Way 16 Bit MUX Problem

bickinator
Never mind I figured it out. I thought the selector bits were ordered differently in the array.
Reply | Threaded
Open this post in threaded view
|

Re: 4 Way 16 Bit MUX Problem

cadet1620
Administrator
bickinator wrote
Never mind I figured it out. I thought the selector bits were ordered differently in the array.
Wires on buses are numbered like bits in registers -- 0 through N-1 starting from the right. This way bit i in the register and wire i on the bus are the 2i weighted bit in the binary value in the register.

--Mark

Reply | Threaded
Open this post in threaded view
|

Re: 4 Way 16 Bit MUX Problem

Bickinator
This post was updated on .
Can you elaborate a little bit please. I'm sorry, but that was slightly over my head. Though maybe once I work through a few more chapters I will understand it better. I understood everything until that last bit.
Reply | Threaded
Open this post in threaded view
|

Re: 4 Way 16 Bit MUX Problem

cadet1620
Administrator
In chapter 2 you will learn how numbers are represented by computers in base-2 (also called binary).
For example, when the number 1234 is stored in a 16-bit register, the individual bits in a the register are
    0000 0100 1101 0010
The bits are numbered starting with 0 on the right. The left-most 1 bit in this particular number is bit 10, and it contributes 210 = 1024 to the number's value.

Buses are always treated as if they were carrying numbers, so their wires are numbered the same was a bits. This is why when sel=100 (binary), the individual wires are sel[2]=1, sel[1]=0 and sel[0]=0.

--Mark

Reply | Threaded
Open this post in threaded view
|

Re: 4 Way 16 Bit MUX Problem

Bickinator
That makes sense now. And I'm working through Chapter 2 now, so this is starting to come together.
Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: 4 Way 16 Bit MUX Problem

DiogoNeves
In reply to this post by bickinator
That happened to me as well :)