Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Rashed Al-Lahaseh
Automated Laundry System
Commits
767d251a
Commit
767d251a
authored
Jul 27, 2021
by
Rashed Al-Lahaseh
Browse files
Add memory entity
Memory Entity
parent
045f2db1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Project/e_memory.vhd
0 → 100644
View file @
767d251a
library
ieee
;
use
ieee
.
std_logic_1164
.
all
;
use
ieee
.
numeric_std
.
all
;
entity
e_memory
is
generic
(
n
:
integer
:
=
8
);
port
(
enable
,
reset
:
in
std_logic
;
washing_machine_address
:
in
std_logic_vector
(
n
-5
downto
0
);
washing_machine_address_available
:
out
boolean
);
end
e_memory
;
architecture
a_memory
of
e_memory
is
type
ram_type
is
array
(
0
to
n
)
of
bit
;
signal
ram
:
ram_type
:
=
(
others
=>
'0'
);
begin
process
(
enable
,
reset
)
begin
if
(
reset
=
'0'
)
then
ram
<=
(
others
=>
'0'
);
elsif
(
enable
=
'0'
)
then
case
ram
(
to_integer
(
unsigned
(
washing_machine_address
)))
is
when
'0'
=>
washing_machine_address_available
<=
true
;
ram
(
to_integer
(
unsigned
(
washing_machine_address
)))
<=
'1'
;
when
'1'
=>
washing_machine_address_available
<=
false
;
end
case
;
end
if
;
end
process
;
end
a_memory
;
\ No newline at end of file
Project/e_memory.vhd.bak
0 → 100644
View file @
767d251a
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment