Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is it better to use multi-threading polling then single threading model?

821


Why embedded system is useful?

893


What are the different types of embedded systems?

804


What are the 4 types of inheritance relationship?

821


Explain what is embedded system in a computer system?

731


How can you stop your dba from making off with a list of your users’ passwords?

933


What happens when recursion functions are declared inline?

862


Do you know what is priority inversion?

799


Tell me what is top half & bottom half of a kernel?

752


What are the uses of the keyword volatile?

928


Explain what is meant by a sandbox, why you would use one, and identify examples of sandboxes in the wild.

829


Please explain can structures be passed to the functions by value?

734


Explain what are real-time embedded systems?

994


How does combination of functions reduce memory requirements in embedded systems?

864


Can we put breakpoint inside isr?

732