Logic Circuits 101: KEEP IT SIMPLE No need for the actual circuit design, just t
ID: 1714858 • Letter: L
Question
Logic Circuits 101:
KEEP IT SIMPLE
No need for the actual circuit design, just the VHDL file will suffice.
Type a VHDL file necessary to meet the following requires:
A battery-powered lamp in a room is to be operated from two switches, one at the back door and one at the front door. The lamp is to be on if the front switch is on and the back switch is off, or if the front switch is off and the back switch is on. The lamp is to be off if both switches are off or if both switches are on. Let a HIGH output represent the on condition and a LOW output represent the off conditions.
Please type the response and paste a screenshot, it can be difficult comparing typed codes to handwritten ones. Thank-you!
Explanation / Answer
LIBRARY ieee ;
USE ieee.std_logic_1164.all ;
ENTITY light IS
PORT ( x1, x2 : IN STD_LOGIC ;
f : OUT STD_LOGIC ) ;
END light ;
ARCHITECTURE LogicFunction OF light IS
BEGIN
f <= (x1 AND NOT x2) OR (NOT x1 AND x2);
END LogicFunction ;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.