Design a circuit to detect when 3 and only 3 bits are set
out of 8 bits.(eg. o0101100)

Answers were Sorted based on User's Feedback



Design a circuit to detect when 3 and only 3 bits are set out of 8 bits.(eg. o0101100)..

Answer / xyz

You fools...the question is to design a circuit
(hardware)..not writing a program.

Is This Answer Correct ?    31 Yes 0 No

Design a circuit to detect when 3 and only 3 bits are set out of 8 bits.(eg. o0101100)..

Answer / esther

Add the digits and check the sum. It would imply a 3-bit
adder (max. value = 8 can be represented with three bits)
and compare the result to 011.

Is This Answer Correct ?    31 Yes 2 No

Design a circuit to detect when 3 and only 3 bits are set out of 8 bits.(eg. o0101100)..

Answer / jayasuriya

Use a 8 bit parallel in serial out shift register. Use the
serial out bit to increment a counter(a 3 bit register), if
its one. After 8 shifts, compare the counter with 011b to
detect 3.

Is This Answer Correct ?    21 Yes 1 No

Design a circuit to detect when 3 and only 3 bits are set out of 8 bits.(eg. o0101100)..

Answer / priya

keep the number in A reg and ratate it 8 times if carry
generates more than 3 it will indicate a non desired numer

Is This Answer Correct ?    12 Yes 5 No

Design a circuit to detect when 3 and only 3 bits are set out of 8 bits.(eg. o0101100)..

Answer / aiyush

The first guy's got it write, every other answer is more
complicated than needed. Also, we cannot use a 3-input AND
like the second guy said b/c we are given 8 bits, not 3. A
3-bit adder and a comparator is all you need.

Is This Answer Correct ?    5 Yes 2 No

Design a circuit to detect when 3 and only 3 bits are set out of 8 bits.(eg. o0101100)..

Answer / ravichandra

step1: start
step2: mov the byte to accumulator
step3: intialize length = 0 , count = 0
step4: rotate acc. to right through carry.
step5: if carry = 1 , increment count
step6: increment length
step7: if length < 8 , goto step3
step8: if count = 3 , (do required action)
step9: end

Is This Answer Correct ?    6 Yes 4 No

Design a circuit to detect when 3 and only 3 bits are set out of 8 bits.(eg. o0101100)..

Answer / arnab kumar biswas

2 bit adder will do the trick.give 0 to one i/p.and transmit
the bits serially one by one to the other i/p.o/p of the
adder goes to latch,where it will stay until 8 bits have
come.then use comparator to compare if answer is 3 or not.

Is This Answer Correct ?    1 Yes 0 No

Design a circuit to detect when 3 and only 3 bits are set out of 8 bits.(eg. o0101100)..

Answer / abc

bt y only 3 bit adder is used??

Is This Answer Correct ?    0 Yes 1 No

Design a circuit to detect when 3 and only 3 bits are set out of 8 bits.(eg. o0101100)..

Answer / kalyanpa

for serially arriving stream:
use a 2 bit accumulator( S1 and S2) with outputs O1 and O2.
Final Output will be Y = ~O1 . O2

For parallel,
use combinational logic , probably priority encoder to
reduce delay.

Is This Answer Correct ?    0 Yes 2 No

Design a circuit to detect when 3 and only 3 bits are set out of 8 bits.(eg. o0101100)..

Answer / gautam bhattacharya

Step 1: Store the 8 bit value in a accumulator

Step 2: Store 0x1 in a register0, initialize two counter
with 0 i.e. store zero in a reg1 and reg2.

LOOP:
Step 3: Check if AND operation between the value in
register0 and accumulator is set i.e. 1
if yes, increment reg1 and reg2
If no, increment only reg2

step 4: Left shift the value of register0 by 1
step 5: if ( reg2 >=8), exit LOOP
if ( reg1 >= 3), show that 3 bit is set
Else Go To LOOP



MOV XAR1, #Data
MOV XAR0, #0
MOV XAR2, #0

Loop:
TBIT *XAR1, #Count
BF Loop1, NTC
INR *XAR0

Loop1:
INR *XAR2
MOV AL, *XAR1
CMP AL, #0x03
BF Loop3, EQ

MOV AL, *XAR2
CMP AL, #0x80
BF Loop, NEQ

Loop3:
EXIT

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More Embedded Systems AllOther Interview Questions

what is Page Fault or Page thrashing ?

3 Answers   Broadcom,


What is continuous integration? Why is it important?

0 Answers  


If you buy some rtos, what are the features you look for in?

0 Answers  


Tell me what are the qualifiers in c?

0 Answers  


Explain some of the commonly found errors in embedded systems?

0 Answers  






When do you know your code is ready for production?

0 Answers  


What is priority inheritance?

0 Answers  


How do malloc and calloc work?

0 Answers  


What are little endian and big endian types of storage? How can you identify which type of allocation a system follows?

0 Answers  


Describe the life-cycle of a software development (application design) process.

0 Answers  


How do the mvp, mvc, and mvvm patterns relate?

0 Answers  


Are you still writing code? Do you love it?

0 Answers  


Categories