Yellow Jackster
Newbie level 2
- Joined
- Jan 26, 2013
- Messages
- 2
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,305
A sensor is used to detect the number of bottles on the conveyor. The user can set any number of bottles he wants to detect on inputs: P4P3P2P1P0. Design a system such that when the reference number is reached, a led turns on and the counts stops at the reference number. Show the number of bottles detected on 5 Leds and the value of the reference on another 5 Leds. After the active-high reset is activated, the counting starts again, the counter returns to 0 and the led is off.
How to draw this programme into block diagram not VHDL using quarts II. I have difficulties in drawing this. There should be 11 LEDs total. But I can program only 6. 5 for q numbers, 1 for LED, But I still need 5 more for showing p number which is input. Any idea Please.
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
USE ieee.std_logic_unsigned.ALL;
ENTITY conveyor IS
PORT(
sensor, reset : in std_logic;
p: in std_logic_vector (4 downto 0);
q: out std_logic_vector (4 downto 0);
led_on: out std_logic);
END conveyor;
ARCHITECTURE arc OF conveyor IS
signal count_sig: unsigned (4 downto 0);
BEGIN
process (sensor, reset)
begin
if (reset = '0') then
count_sig <= "00000";
Led_on <= "1";
elsif falling_edge (sensor) then
if count_sig/= unsigned (p) then
count_sig <= count_sig +1;
else
led_on <=’0’;
end if;
end if;
end process;
q <= std_logic_vector (count_sig);
end flow;
Thank You
How to draw this programme into block diagram not VHDL using quarts II. I have difficulties in drawing this. There should be 11 LEDs total. But I can program only 6. 5 for q numbers, 1 for LED, But I still need 5 more for showing p number which is input. Any idea Please.
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
USE ieee.std_logic_unsigned.ALL;
ENTITY conveyor IS
PORT(
sensor, reset : in std_logic;
p: in std_logic_vector (4 downto 0);
q: out std_logic_vector (4 downto 0);
led_on: out std_logic);
END conveyor;
ARCHITECTURE arc OF conveyor IS
signal count_sig: unsigned (4 downto 0);
BEGIN
process (sensor, reset)
begin
if (reset = '0') then
count_sig <= "00000";
Led_on <= "1";
elsif falling_edge (sensor) then
if count_sig/= unsigned (p) then
count_sig <= count_sig +1;
else
led_on <=’0’;
end if;
end if;
end process;
q <= std_logic_vector (count_sig);
end flow;
Thank You