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

Answer Posted / gautam

I have modified it a bit,

MOVL XAR1, #Data
MOVL XAR0, #0x00
MOVL XAR2, #0x00

Loop:
TBIT *XAR1,#XAR2
BF Loop1, NTC
INR AR0

Loop1:
INR AR2
MOV AL, *XAR0
CMP AL, @0x03
BF Action, EQ

MOV AL, *XAR2
CMP AL, @0x08
BF Loop, NEQ

Loop3:
EXIT

Action:

Is This Answer Correct ?    0 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is the single responsibility principle important?

462


Why are interfaces important?

480


Which is the best way to write loops?

480


Tell me can we use any function inside isr?

417


What is the difference between "set" logic, and "procedural" logic. When would you use each one and why?

424






can a pointer be volatile ? Explain.

468


How do malloc and calloc work?

454


What is the repository pattern? Why are patterns important?

462


What is the last programming book you read?

424


Explain me how does the interrupt architecture works?

446


Explain whether we can use semaphore or mutex or spinlock in interrupt context in linux kernel?

476


Describe a pattern that is not the factory pattern?

446


What is mutex in an embedded system?

439


How might a task-based model differ from a threaded model?

442


Tell me when one must use recursion function? Mention what happens when recursion functions are declared inline?

448