Show the binary and hex contents of PORTA an output port aft


Show the binary and hex contents of PORTA (an output port) after execution of each of the following C statements. PORTA = 0x45 | 0xf0; PORTA = 0xC4 & 0x66; PORTA = 0xFF 0x81; PORTA = 0xAA;//after execution of both of these instructions... PORTA = ~PORTA; Write a short C program that copies the 5 values from the array called list 1 and stores them into their corresponding locations In another array list 2, after masking off the upper nibble (use the & operator). Use a for() loop to do the copying. Start by declaring both lists as char arrays, and initialize list 1 with the values 8, 7, 6, 5, 4.

Solution


(4)

(a)

Binary and Hex form of 45 is, 00101101 and 2D

Binary and Hex form of F0 is, 11110000 and F0

(b)

Binary and Hex form of C4 is, 11000100 and C4

Binary and Hex form of 66 is, 01000010 and 42

(c)

Binary and Hex form of FF is, 11111111 and FF

Binary and Hex form of 81 is, 01010001 and 51

(d)

Binary and Hex form of AA is, 1010 1010 and AA

 Show the binary and hex contents of PORTA (an output port) after execution of each of the following C statements. PORTA = 0x45 | 0xf0; PORTA = 0xC4 & 0x66;

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site