# Design combinational circuit interview question

Design a combinational circuit which gives high output when any 2 bits of 8 bit register are high. Can that be extended such that 3 bits 4 bits...etc

•

2. ## circuit interview question

Output <= '1' when (reg(0) + reg(1) + reg(2) + reg(3)
+ reg(4) + reg(5) + reg(6) + reg(7))
=> "00000010" else
'0';

I think this will give ans...
Please correct me if I am wrong.

•

3. ## Re: Design combinational circuit interview question

yes, it can be extended.
for any 2 bits case:
assign out2 = r0 & ( r1| r2|r3|r4|r5|r6|r7)
| r1 & ( r2|r3|r4|r5|r6|r7)
| r2 & ( r3|r4|r5|r6|r7)
| r3 & ( r4|r5|r6|r7)
| r4 & ( r5|r6|r7)
| r5 & ( r6|r7)
| r6 & ( r7)

•

4. ## Design combinational circuit interview question

Hi
@ray123
if my 8 bit reg has 01110000
then I should get '0' as output
But ur solution gives '1'
@shanmugaveld
ya 2 4-bit full adders will do.
but can it b more simple.

5. ## Re: Design combinational circuit interview question

Yes, if 3-bit high case can be treated as the subset of any 2-bit high case, an adder implementation is good enough.

•

6. ## Design combinational circuit interview question

You can also traditional approach of k-map, if you don't like to use adders in your logic.

Split your 8-bit bus to two 4-bit busses, for each four bit bus, try to find exactly one 1's, exactly 2 1's and exactly 0 1's anthen u need to simply form the logic for 0+2, 2+0 and 1+1

The same procedure can be applied to if you want find for three 1's inside your 8-bit bus that would be : 0+3,3+0,1+2,2+1

--[[ ]]--