Skip to content

Commit

Permalink
Merge pull request #33 from MaximSpeczyk/refined-draft
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximSpeczyk authored Jun 22, 2023
2 parents 8bd2d3d + 5a48b77 commit 54a98ed
Show file tree
Hide file tree
Showing 136 changed files with 8,218 additions and 22 deletions.
Binary file not shown.
77 changes: 77 additions & 0 deletions HardwareEngineering/PCB/VendingMachine.kicad_prl
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"board": {
"active_layer": 0,
"active_layer_preset": "",
"auto_track_width": true,
"hidden_netclasses": [],
"hidden_nets": [],
"high_contrast_mode": 0,
"net_color_mode": 1,
"opacity": {
"images": 0.6,
"pads": 1.0,
"tracks": 1.0,
"vias": 1.0,
"zones": 0.6
},
"selection_filter": {
"dimensions": true,
"footprints": true,
"graphics": true,
"keepouts": true,
"lockedItems": false,
"otherItems": true,
"pads": true,
"text": true,
"tracks": true,
"vias": true,
"zones": true
},
"visible_items": [
0,
1,
2,
3,
4,
5,
8,
9,
10,
11,
12,
13,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
32,
33,
34,
35,
36,
39,
40
],
"visible_layers": "fffffff_ffffffff",
"zone_display_mode": 0
},
"meta": {
"filename": "VendingMachine.kicad_prl",
"version": 3
},
"project": {
"files": []
}
}
Binary file not shown.
123 changes: 123 additions & 0 deletions HardwareEngineering/VHDL Project/Debugged/VM.vhd
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.std_logic_unsigned.all;
use IEEE.std_logic_arith.all;

entity VM is

port (

clk, reset: in std_logic;
coin_in, pickItem: in std_logic_vector(3 downto 0);
selectedItem, dispense: out std_logic_vector(3 downto 0);
refundOutLed: out std_logic


);

end entity;

architecture VMarch of VM is

signal total, refund, price, product : integer := 0;
type state is( idle, selected, review, output);
signal current_state, next_state : state;
signal greaterEqual : std_logic := '0';

begin

memory: process (clk, reset)
begin

if (reset ='1') then
current_state <= idle;
elsif (rising_edge(clk)) then
current_state <= next_state;
end if;

end process;

logic: process (coin_in, pickItem, current_state)
begin


case (current_state) is

when idle => if ( pickItem = "0001" ) then
next_state <= selected;
product <= 1;
price <=4;

elsif ( pickItem = "0010" ) then
next_state <= selected;
product <= 2;
price <=3;
elsif ( pickItem = "0011" ) then
next_state <= selected;
product <= 3;
price <=2;
else
next_state <= idle;
product <= 0;
price <=0;
end if;

when selected => if ( coin_in = "0101" ) then
total <= 5;
next_state <= review;


elsif ( coin_in = "0100" ) then
total <= 4;
next_state <= review;

elsif ( coin_in = "0011" ) then
total <= 3;
next_state <= review;

elsif ( coin_in = "0010") then
total <= 2;
next_state <= review;
else
total <= 0;
next_state <= selected;
end if;


when review => if (total >= price) then
refund <= total - price;
refundOutLed <= '1';
next_state <= output;
else
refund <= 0;
refundOutLed <= '0';
next_state <= selected;

end if;

when output =>
if (product = 1) then
dispense <= "0001";
next_state <= idle;
elsif (product = 2) then
dispense <= "0010";
next_state <= idle;
elsif (product = 3) then
dispense <= "0011";
next_state <= idle;
else
next_state <= selected;
end if;



end case;






end process;

end architecture;
123 changes: 123 additions & 0 deletions HardwareEngineering/VHDL Project/Debugged/VM.vhd.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.std_logic_unsigned.all;
use IEEE.std_logic_arith.all;

entity VM is

port (

clk, reset: in std_logic;
coin_in, pickItem: in std_logic_vector(3 downto 0);
selectedItem, dispense: out std_logic_vector(3 downto 0);
refundOutLed: out std_logic;


);

end entity;

architecture VMarch of VM is

signal total, refund, price, product : integer := 0;
type state is( idle, selected, review, output);
signal current_state, next_state : state;
signal greaterEqual : std_logic := '0';

begin

memory: process (clk, reset)
begin

if (reset ='1') then
current_state <= idle;
elsif (rising_edge(clk)) then
current_state <= next_state;
end if;

end process;

logic: process (coin_in, pickItem, current_state)
begin


case (current_state) is

when idle => if ( pickItem = "0001" ) then
next_state <= selected;
product <= 1;
price <=4;

elsif ( pickItem = "0010" ) then
next_state <= selected;
product <= 2;
price <=3;
elsif ( pickItem = "0011" ) then
next_state <= selected;
product <= 3;
price <=2;
else
next_state <= idle;
product <= 0;
price <=0;
end if;

when selected => if ( coin_in = "0101" ) then
total <= 5;
next_state <= review;


elsif ( coin_in = "0100" ) then
total <= 4;
next_state <= review;

elsif ( coin_in = "0011" ) then
total <= 3;
next_state <= review;

elsif ( coin_in = "0010") then
total <= 2;
next_state <= review;
else
total <= 0;
next_state <= selected;
end if;


when review => if (total >= price) then
refund <= total - price;
refundOutLed <= '1';
next_state <= output;
else
refund <= 0;
refundOutLed <= '0';
next_state <= selected;

end if;

when output =>
if (product = 1) then
dispense <= "0001";
next_state <= idle;
elsif (product = 2) then
dispense <= "0010";
next_state <= idle;
elsif (product = 3) then
dispense <= "0011";
next_state <= idle;
else
next_state <= selected;
end if;



end case;






end process;

end architecture;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version:1
57656254616c6b5472616e736d697373696f6e417474656d70746564:3
6d6f64655f636f756e7465727c4755494d6f6465:5
eof:
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
version:1
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d70617274:78633761313030746373673332342d31:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d6e616d65:64656661756c743a3a5b6e6f745f7370656369666965645d:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d746f70:564d:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d696e636c7564655f64697273:64656661756c743a3a5b6e6f745f7370656369666965645d:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d67656e65726963:64656661756c743a3a5b6e6f745f7370656369666965645d:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d766572696c6f675f646566696e65:64656661756c743a3a5b6e6f745f7370656369666965645d:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d636f6e737472736574:64656661756c743a3a5b6e6f745f7370656369666965645d:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d7365755f70726f74656374:64656661756c743a3a6e6f6e65:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d666c617474656e5f686965726172636879:64656661756c743a3a72656275696c74:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d67617465645f636c6f636b5f636f6e76657273696f6e:64656661756c743a3a6f6666:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d646972656374697665:64656661756c743a3a64656661756c74:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d696e6372656d656e74616c5f6d6f6465:64656661756c743a3a64656661756c74:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d72746c:64656661756c743a3a5b6e6f745f7370656369666965645d:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d6c696e74:64656661756c743a3a5b6e6f745f7370656369666965645d:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d66696c65:64656661756c743a3a5b6e6f745f7370656369666965645d:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d64617461666c6f77:64656661756c743a3a5b6e6f745f7370656369666965645d:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d64617461666c6f775f73657474696e6773:64656661756c743a3a6e6f6e65:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d72746c5f736b69705f6970:64656661756c743a3a5b6e6f745f7370656369666965645d:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d72746c5f736b69705f636f6e73747261696e7473:64656661756c743a3a5b6e6f745f7370656369666965645d:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d6e6f5f6c63:64656661756c743a3a5b6e6f745f7370656369666965645d:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d6f73:64656661756c743a3a5b6e6f745f7370656369666965645d:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d62756667:64656661756c743a3a3132:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d66616e6f75745f6c696d6974:64656661756c743a3a3130303030:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d73687265675f6d696e5f73697a65:64656661756c743a3a33:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d6d6f6465:64656661756c743a3a64656661756c74:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d66736d5f65787472616374696f6e:64656661756c743a3a6175746f:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d6b6565705f6571756976616c656e745f726567697374657273:64656661756c743a3a5b6e6f745f7370656369666965645d:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d7265736f757263655f73686172696e67:64656661756c743a3a6175746f:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d636173636164655f647370:64656661756c743a3a6175746f:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d636f6e74726f6c5f7365745f6f70745f7468726573686f6c64:64656661756c743a3a6175746f:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d6d61785f6272616d:64656661756c743a3a2d31:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d6d61785f7572616d:64656661756c743a3a2d31:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d6d61785f647370:64656661756c743a3a2d31:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d6d61785f6272616d5f636173636164655f686569676874:64656661756c743a3a2d31:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d6d61785f7572616d5f636173636164655f686569676874:64656661756c743a3a2d31:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d726574696d696e67:64656661756c743a3a5b6e6f745f7370656369666965645d:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d6e6f5f726574696d696e67:64656661756c743a3a5b6e6f745f7370656369666965645d:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d6e6f5f73726c65787472616374:64656661756c743a3a5b6e6f745f7370656369666965645d:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d617373657274:64656661756c743a3a5b6e6f745f7370656369666965645d:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d6e6f5f74696d696e675f64726976656e:64656661756c743a3a5b6e6f745f7370656369666965645d:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d73666375:64656661756c743a3a5b6e6f745f7370656369666965645d:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d64656275675f6c6f67:64656661756c743a3a5b6e6f745f7370656369666965645d:00:00
73796e746865736973:73796e7468657369735c636f6d6d616e645f6c696e655f6f7074696f6e73:2d657374:64656661756c743a3a5b6e6f745f7370656369666965645d:00:00
73796e746865736973:73796e7468657369735c7573616765:656c6170736564:30303a30303a353873:00:00
73796e746865736973:73796e7468657369735c7573616765:6d656d6f72795f7065616b:313339302e3839354d42:00:00
73796e746865736973:73796e7468657369735c7573616765:6d656d6f72795f6761696e:3931372e3035314d42:00:00
eof:2338423204
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
version:1
73796e746865736973:73796e7468657369735c7573616765:686c735f6970:30:00:00
eof:2511430288
Loading

0 comments on commit 54a98ed

Please sign in to comment.