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)..

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

 Is This Answer Correct ? 30 Yes 0 No

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

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)..

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)..

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)..

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)..

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)..

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)..

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)..

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)..

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

More Embedded Systems AllOther Interview Questions

Explain the difference between a microcontroller and an embedded system?

What do you do to stay abreast of the latest technologies and tools?

How do you identify hardware errors?

Is count down_to_zero loop better than count_up_loops?

Tell us what is the need for an infinite loop in embedded systems?

What happens when recursion functions are declared inline?

Left to your own devices, what would you create?

What are the languages used in embedded system?

Given time, cost, client satisfaction and best practices, how will you prioritize them for a project you are working on? Explain why.

What is inversion of control?

Explain what are the differences between analytical and computational modeling?

What are the characteristics of embedded system?

Categories