Answered step by step
Verified Expert Solution
Question
1 Approved Answer
mbed Question 2: Write the low-level C code that carries out the logical operations NOT, AND, OR, and XOR on two digital inputs a &
mbed
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 Quick Start board. The code should be structured as follows: Set the pushbutton on the QuickStart as digital input a, such that it is 1 when pressed and o otherwise. Fix digital input bas 0. Define the LEDs' output as follows: o LED1: NOT a o LED2: a AND o LED3: a OR o LED4: a XOR b The output should look as follows: o When pushbutton is not pressed, only LED1 should be active. o 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. 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 Quick Start board. The code should be structured as follows: Set the pushbutton on the QuickStart as digital input a, such that it is 1 when pressed and o otherwise. Fix digital input bas 0. Define the LEDs' output as follows: o LED1: NOT a o LED2: a AND o LED3: a OR o LED4: a XOR b The output should look as follows: o When pushbutton is not pressed, only LED1 should be active. o 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. Deliverables: Paragraph explaining what the code is doing. Well-commented C code. Submission on eCampus only. Demo during lab time on 31st JanuaryStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started