Question: Question 2: Write the low-level C code that carries out the logical operations NOT, AND, OR, and XOR on two digital inputs a & b,

Question 2: Write the low-level C code that carries out the logical operations NOT, AND, OR, and XOR on two digital inputs a & b, and displays the output using the LEDs on the QuickStart board. The code should be structured as follows: O Set the pushbutton on the Quick Start as digital input a, such that it is 1 when pressed and 0 otherwise. Fix digital input b as 0. Define the LEDs' output as follows: LED1: NOT a LED2: a AND b LED3: a OR LED4: a XOR b The output should look as follows: When pushbutton is not pressed, only LED1 should be active. When pushbutton is pressed, only LED3 and LED4 should be active. Keep in mind when writing your code that LED1 and LED2 are active low (i.e. they turn on with an input of 0) and LED3 and LED4 are active high. O Deliverables: . . Paragraph explaining what the code is doing. Well-commented C code. Submission on eCampus only. Demo during lab time on 31st January. . Question 2: Write the low-level C code that carries out the logical operations NOT, AND, OR, and XOR on two digital inputs a & b, and displays the output using the LEDs on the QuickStart board. The code should be structured as follows: O Set the pushbutton on the Quick Start as digital input a, such that it is 1 when pressed and 0 otherwise. Fix digital input b as 0. Define the LEDs' output as follows: LED1: NOT a LED2: a AND b LED3: a OR LED4: a XOR b The output should look as follows: When pushbutton is not pressed, only LED1 should be active. When pushbutton is pressed, only LED3 and LED4 should be active. Keep in mind when writing your code that LED1 and LED2 are active low (i.e. they turn on with an input of 0) and LED3 and LED4 are active high. O Deliverables: . . Paragraph explaining what the code is doing. Well-commented C code. Submission on eCampus only. Demo during lab time on 31st January
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
