Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

the following bit of code and 16-bit register definition: (10) BRW CTL: 0x00630

ID: 3903383 • Letter: T

Question

the following bit of code and 16-bit register definition: (10) BRW CTL: 0x00630 Bits 0-1 Description 00b: LEDs off 0lb: Right LED on 10b: Left LED on 11b: Reserved 2-5 Reserved Ob: Afterburner off lb: Afterburner on 6 000b: Brewing off 001b: Drip coffee mode on 010b: K-cup mode on 100-111b: Reserved 7-9 10-15 Reserved int fd open ("/dev/mem", O_RDONLY) sizeof (PCI BARO), PROT READ, MAP-SHARED, fa, void *mem= mmap (NULL, BARO OFESET) a. Assuming Reserved fields are written with a Ob, what would the value be to turn on the Right LED while brewing K-cup coffee with the afterburner enabled? b. Using the mmap () 'd segment above and the register definition above, write this value to the BRW CTL register

Explanation / Answer

Answer is as follows :

a) According to the given question we have,

0-1 bits are set to 01b because of Right LED is on

2-5 are set to 0000b as they are reserved

6 bit is set to 1 b as we hae afterburner is enabled/on.

7-9 are set as 010 b as we have K-cup mode is on.

10 - 15 are set to 000000 as they are resrved.

Now we know that 0 bit is set as LSB and 15 bit is MSB.

So the generated data is :

or we can write as :

0-1 2-5 6 7-9 10-15 01 0000 1 010 000000