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
Answer / xyz
You fools...the question is to design a circuit
(hardware)..not writing a program.
|Is This Answer Correct ?||30 Yes||0 No|
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|
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
|Is This Answer Correct ?||21 Yes||1 No|
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|
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|
Answer / ravichandra
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)
|Is This Answer Correct ?||6 Yes||4 No|
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|
Answer / abc
bt y only 3 bit adder is used??
|Is This Answer Correct ?||0 Yes||1 No|
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
use combinational logic , probably priority encoder to
|Is This Answer Correct ?||0 Yes||2 No|
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.
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
TBIT *XAR1, #Count
BF Loop1, NTC
MOV AL, *XAR1
CMP AL, #0x03
BF Loop3, EQ
MOV AL, *XAR2
CMP AL, #0x80
BF Loop, NEQ
|Is This Answer Correct ?||0 Yes||3 No|
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?