Notes
Notes - notes.io |
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity JK is
PORT ( J,K,CLOCK,R : IN STD_LOGIC;
Q : INOUT STD_LOGIC);
end JK;
architecture Behavioral of JK is
begin
PROCESS (CLOCK,R)
BEGIN
IF (R='1') THEN
Q<='0';
ELSIF (CLOCK'EVENT AND CLOCK='1') THEN
IF (J='0' AND K='0') THEN
Q<=Q;
ELSIF (J='0' AND K='1') THEN
Q<='0';
ELSIF (J='1' AND K='0') THEN
Q<='1';
ELSIF (J='1' AND K='1') THEN
Q<=NOT Q;
END IF;
END IF;
END PROCESS;
end Behavioral;
-----------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity VENDING is
PORT ( COIN,WATER,BEER,CLOCK,R : IN STD_LOGIC;
SEND_W,SEND_B,CHANGE : OUT STD_LOGIC);
end VENDING;
architecture Behavioral of VENDING is
COMPONENT JK is
PORT ( J,K,CLOCK,R : IN STD_LOGIC;
Q : INOUT STD_LOGIC);
end COMPONENT;
SIGNAL Q1,Q2,Q3,Q4,RESET,CCOIN,FULL : STD_LOGIC;
begin
CCOIN <= CLOCK AND COIN; -- when you put coin, coin process with clock signal
RESET <= R OR ((NOT CLOCK) AND ((Q4 AND BEER) OR (Q4 AND WATER) OR (Q3 AND WATER) OR (Q2 AND WATER))); -- External reset or reset of item sending
JK_25 : JK PORT MAP ('1','0',CCOIN,RESET,Q1); -- 1 quarter cent
JK_50 : JK PORT MAP (Q1,NOT Q1,CCOIN,RESET,Q2); -- 2 quarter cent
JK_75 : JK PORT MAP (Q2,NOT Q2,CCOIN,RESET,Q3); -- 3 quarter cent
JK_100 : JK PORT MAP (Q3,NOT Q3,CCOIN,RESET,Q4); -- 4 quarter cent
JK_CHANGE : JK PORT MAP (Q4,NOT Q4,CCOIN,RESET,FULL); -- Full signal after 4 quarter cent
CHANGE <= (Q4 AND BEER) OR (Q4 AND WATER) OR (Q3 AND WATER) OR (Q2 AND WATER) OR (FULL AND COIN); -- give 5th quarter cent back or change delivery
SEND_W <= (Q4 AND WATER) OR (Q3 AND WATER) OR (Q2 AND WATER) OR (Q1 AND WATER); -- activate water sending
SEND_B <= (Q4 AND BEER) OR (Q3 AND BEER); -- activate beer sending
end Behavioral;
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team