The PIC18F4321 microcontroller is required to test a NAND gate. The Figure shows the I/O hardware needed to test the NAND gate. The microcontroller is to be programmed to generate the various logic conditions for the NAND inputs. Input the NAND output and turn the LED ON connected at bit 3 of port D if the NAND gate chip is found to be faulty. Otherwise, turn the LED ON connected at bit 4 of port D. +5V +5V Bit 0 of portD Bit 1 of portD D 330 Ω 330 Ω LED ✓ LED Bit 2 of portD Bit 3 of portD Bit 4 of portD PIC18F4321 με Complete the following code to achieve the requirements then copy or upload your completed code
The PIC18F4321 microcontroller is required to test a NAND gate. The Figure shows the I/O hardware needed to test the NAND gate. The microcontroller is to be programmed to generate the various logic conditions for the NAND inputs. Input the NAND output and turn the LED ON connected at bit 3 of port D if the NAND gate chip is found to be faulty. Otherwise, turn the LED ON connected at bit 4 of port D. +5V +5V Bit 0 of portD Bit 1 of portD D 330 Ω 330 Ω LED ✓ LED Bit 2 of portD Bit 3 of portD Bit 4 of portD PIC18F4321 με Complete the following code to achieve the requirements then copy or upload your completed code
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
#include <xc.h> void ____(void);
void main (void) { TRISDbits.TRISD0 = ____;
TRISDbits.TRISD1 = 0;
TRISDbits.TRISD2 = ____;
TRISDbits.TRISD3 = 0; ____ = 0;
PORTDbits.RD0 = ____; PORTDbits.RD1 = 0; if(____ == 0)
fail();
PORTDbits.RD0 = ____; PORTDbits.RD1 = 1; if(PORTDbits.RD2 == 0)
fail();
____ = 1; PORTDbits.RD1 = 0; if(____ == 0)
____;
PORTDbits.RD0 = ____; PORTDbits.RD1 = ____; if(PORTDbits.RD2 == ____)
fail();
while(1) { PORTDbits.RD3 = 1; PORTDbits.RD4 = 0; } }
void fail(void) { while(1) { PORTDbits.RD3 = ____; PORTDbits.RD4 = ____; } }
![The PIC18F4321 microcontroller is required to test a NAND gate. The Figure shows the I/O
hardware needed to test the NAND gate. The microcontroller is to be programmed to generate the
various logic conditions for the NAND inputs. Input the NAND output and turn the LED ON
connected at bit 3 of port D if the NAND gate chip is found to be faulty. Otherwise, turn the LED ON
connected at bit 4 of port D.
+5V
+5V
Bit 0 of portD
Bit 1 of portD
D
330 Ω
330 Ω
LED
✓ LED
Bit 2 of portD
Bit 3 of portD
Bit 4 of portD
PIC18F4321
με
Complete the following code to achieve the requirements then copy or upload your completed
code](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F83b97d9f-eac5-4c59-98f4-44d1d3519004%2Fd62a4a40-f73e-4447-b938-06fa3e1ecae3%2F86gpnai_processed.png&w=3840&q=75)
Transcribed Image Text:The PIC18F4321 microcontroller is required to test a NAND gate. The Figure shows the I/O
hardware needed to test the NAND gate. The microcontroller is to be programmed to generate the
various logic conditions for the NAND inputs. Input the NAND output and turn the LED ON
connected at bit 3 of port D if the NAND gate chip is found to be faulty. Otherwise, turn the LED ON
connected at bit 4 of port D.
+5V
+5V
Bit 0 of portD
Bit 1 of portD
D
330 Ω
330 Ω
LED
✓ LED
Bit 2 of portD
Bit 3 of portD
Bit 4 of portD
PIC18F4321
με
Complete the following code to achieve the requirements then copy or upload your completed
code
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY