Complete the code to declare a 2-to-4 decoder output signal.
signal output_lines : std_logic_vector([1] downto 0);
The output of a 2-to-4 decoder has 4 lines, indexed from 3 down to 0.
Complete the code to assign the output of a 2-to-4 decoder based on input bits.
output_lines <= ("0001" when input_bits = "00" else "0010" when input_bits = "01" else "0100" when input_bits = "10" else [1]);
The last case for input_bits = "11" should activate the last output line, which is "1000".
Fix the error in the encoder process sensitivity list.
process([1]) begin case input_lines is when "0001" => output_bits <= "00"; when "0010" => output_bits <= "01"; when "0100" => output_bits <= "10"; when "1000" => output_bits <= "11"; when others => output_bits <= "00"; end case; end process;
The process sensitivity list must include the signal that triggers the process, which is input_lines.
Fill both blanks to complete the 3-to-8 decoder output assignment with enable.
with input_bits select output_lines <= [1] when "000", [2] when others;
When input_bits is "000", only the first output line is high "00000001"; otherwise, all outputs are low "00000000".
Fill all three blanks to complete the priority encoder output logic.
process(input_lines) begin if input_lines([1]) = '1' then output_bits <= "[2]"; elsif input_lines([3]) = '1' then output_bits <= "01"; else output_bits <= "00"; end if; end process;
The highest priority input is bit 3, outputting "11"; next priority is bit 2, outputting "01".