Question

In: Electrical Engineering

VHDL Code will not run simulation. What is the problem with my code?? --VHDL Code library...

VHDL Code will not run simulation. What is the problem with my code??

--VHDL Code

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.NUMERIC_STD.ALL;

entity DataMemory16Bits is
Port ( Address_DM : in STD_LOGIC_VECTOR(15 downto 0);
Data_In_DM : in STD_LOGIC_VECTOR(15 downto 0);
Clock : in STD_LOGIC;
We_DM : in STD_LOGIC;
Re_DM : in STD_LOGIC;
Data_Out_DM : out STD_LOGIC_VECTOR(15 downto 0));
end DataMemory16Bits;

architecture Behavioral of DataMemory16Bits is
Type DataMemory16Bits is array(0 to 31) of STD_LOGIC_VECTOR(15 downto 0);
signal memory: DataMemory16Bits;

begin
process (Address_DM, Clock, We_DM, Re_DM)
begin
Data_Out_DM <= (Others=>'Z');
if (Clock='1')
then
if We_DM='1' and Re_DM='0'
then
Memory(to_integer(unsigned(Address_DM))<= Data_In_DM;
end if;
if Re_DM='1' and We_DM='0'
then
Memory(to_integer(unsigned(Data_In_DM)<= Address_DM;
end if;
if Re_DM='1' and We_DM='1'
then
Data_Out_DM<=Memory(to_integer(unsigned(Address_DM);
else
Data_Out_DM<=(Others=>'Z');
end if;
end if;
end process;
end Behavioral;

Solutions

Expert Solution

-- See cooments with correct code

library IEEE;

use IEEE.STD_LOGIC_1164.ALL;

use IEEE.STD_LOGIC_ARITH.ALL;

use IEEE.STD_LOGIC_UNSIGNED.ALL; ---Include this library package

entity DataMemory16Bits is

Port ( Address_DM : in STD_LOGIC_VECTOR(15 downto 0);

Data_In_DM : in STD_LOGIC_VECTOR(15 downto 0);

Clock : in STD_LOGIC;

We_DM : in STD_LOGIC;

Re_DM : in STD_LOGIC;

Data_Out_DM : out STD_LOGIC_VECTOR(15 downto 0));

end DataMemory16Bits;

architecture Behavioral of DataMemory16Bits is

Type DataMemory16Bits is array(0 to 65535) of STD_LOGIC_VECTOR(15 downto 0);

-- Since ----address is 16 bit then locations will be 2*16 = 65536

signal memory: DataMemory16Bits;

begin

process (Address_DM, Clock, We_DM, Re_DM)

begin

Data_Out_DM <= (Others=>'Z');

if (Clock='1' and Clock'event)then --- Memory is always edge triggered. Event trigger causes false data write

if (We_DM='1' and Re_DM='0') then

Memory(conv_integer(Address_DM))<= Data_In_DM; --- use conv function and close brackets were --missing

end if;

if (Re_DM='1' and We_DM='0') then

Memory(conv_integer(Data_In_DM))<= Address_DM; --- use conv function and close brackets were - --missing

end if;

if (Re_DM='1' and We_DM='1')then

Data_Out_DM<=Memory(conv_integer(Address_DM)); --- use conv function and close brackets were --missing

else

Data_Out_DM<=(Others=>'Z');

end if;

end if;

end process;

end Behavioral;

---- Simulation on ModelSim


Related Solutions

Design in VHDL a gray code decoder to excess 3 code Screenshot the simulation and code.
Design in VHDL a gray code decoder to excess 3 code Screenshot the simulation and code.
Design in VHDL a 8-1 Multiplexer Screenshot the simulation and code.
Design in VHDL a 8-1 Multiplexer Screenshot the simulation and code.
Design in VHDL a 16-1 Demultiplexer Screenshot the simulation and code.
Design in VHDL a 16-1 Demultiplexer Screenshot the simulation and code.
Provide the VHDL code and simulation results for a mod-7 counter, with asynchronous active low reset.
Provide the VHDL code and simulation results for a mod-7 counter, with asynchronous active low reset.
Can someone run this in vhdl and send me the output? acreenshot library IEEE; use IEEE.STD_LOGIC_1164.ALL;...
Can someone run this in vhdl and send me the output? acreenshot library IEEE; use IEEE.STD_LOGIC_1164.ALL; entity VHDL_MOORE_FSM_Sequence_Detector is port ( clock: in std_logic; --- clock signal reset: in std_logic; -- reset input sequence_in: in std_logic; -- binary sequence input detector_out: out std_logic -- output of the VHDL sequence detector ); end VHDL_MOORE_FSM_Sequence_Detector; architecture Behavioral of VHDL_MOORE_FSM_Sequence_Detector is type MOORE_FSM is (Zero, One, OneZero, OneZeroZero, OneZeroZeroOne); signal current_state, next_state: MOORE_FSM; begin -- Sequential memory of the VHDL MOORE FSM Sequence...
CAN SOMEONE RUN THIS WITH VHDL AND SEND ME THE OUTPUT? LIBRARY ieee; USE ieee.std_logic_1164.ALL; ENTITY...
CAN SOMEONE RUN THIS WITH VHDL AND SEND ME THE OUTPUT? LIBRARY ieee; USE ieee.std_logic_1164.ALL; ENTITY LFSR8 IS PORT (Clk, Rst: IN std_logic; output: OUT std_logic_vector (7 DOWNTO 0)); END LFSR8; ARCHITECTURE LFSR8_beh OF LFSR8 IS SIGNAL Currstate, Nextstate: std_logic_vector (7 DOWNTO 0); SIGNAL feedback: std_logic; BEGIN StateReg: PROCESS (Clk,Rst) BEGIN IF (Rst = '1') THEN Currstate <= (0 => '1', OTHERS =>'0'); ELSIF (Clk = '1' AND Clk'EVENT) THEN Currstate <= Nextstate; END IF; END PROCESS; feedback <= Currstate(4)...
Below is my source code for file merging. when i run the code my merged file...
Below is my source code for file merging. when i run the code my merged file is blank and it never shows merging complete prompt. i dont see any errors or why my code would be causing this. i saved both files with male names and female names in the same location my source code is in as a rtf #include #include #include using namespace std; int main() { ifstream inFile1; ifstream inFile2; ofstream outFile1; int mClientNumber, fClientNumber; string mClientName;...
this is my Matlab code for lemur and plant population simulation. But i didn't get the...
this is my Matlab code for lemur and plant population simulation. But i didn't get the right graph. R(1,1)=35; % Initial pop of males R(2,1)=35; % Initial pop of females P(3,1)=200000; % Iniitial pop of plants r(1)=1.01; % Growth rate of male pop r(2)=1.01; % Growth rate of female pop r(3)=1.10; % Growth rate of plants K(1)=800; % Carrying capacity for male pop K(2)=600; % carrying capacity for female pop K(3)=7500000; % carrying capacity for plants    E=65; % Plants...
Simulate this code in ISE Simulator (ISim) and screenshot the simulation library IEEE; use IEEE.STD_LOGIC_1164.ALL; use...
Simulate this code in ISE Simulator (ISim) and screenshot the simulation library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity multiplexer is Port (     din:in STD_LOGIC_VECTOR (7 downto 0);    sel:in STD_LOGIC_VECTOR (2 downto 0);    dout : out STD_LOGIC); end multiplexer; architecture Behavioral of multiplexer is begin     process (din,sel)     begin       case sel is            when "000"=> dout <= din(7);            when "001"=> dout <= din(6);            when "010"=> dout <= din(5);            when "011"=>...
For this problem, you will run a simulation to investigate how violating the assumption of normally...
For this problem, you will run a simulation to investigate how violating the assumption of normally distributed data can affect the properties of a t-test. a). The gamma distribution is skewed to the right. It contains a parameter called “shape”. The R function for generating data from a gamma distribution is rgamma – you can read the details in R help. Make three historgrams, each of a sample of size n = 10,000 drawn from a gamma distribution, with shape...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT