0
Write a C function that implements a 3-bit mux, following the pattern I showed in class. Remember: &&, || and ! are used to represent the logic gates. For testing, your program should behave as follows:

three control bits: 1 1 0
eight inputs: 0 0 0 0 0 0 1 0
answer: 1

The user types control bits 110, or 6, and the program returns
the 6th input - which is the only 1.

I am NOT asking for the code. I just am confused what it wants me to do. I was not able to attend this class. How does it get 1 as the 6th input. looks like the 6th input is 0 and the 7th is 1.

I am not really familiar with mux. Any help would be greatly appreciated.

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by abhimanipal
0

Bit fiddlers generally start counting at bit 0. (Which does have a nice symmetry with arrays being zero based too.)

[edit]Are you familiar with things like & , | , ~ , >> , and << ? I'd bet they'll be your basic 'tools'. I'm wondering what else was missed (by me) if the instructions mention the logical ops.

Edited by Dave Sinkula: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.