All About Circuits Forum  

Go Back   All About Circuits Forum > Software, Microcomputing, and Communications Forums > Programmer's Corner

Notices

Programmer's Corner Discussion forum for all aspects of programming and software engineering. Any software programming language welcome: C, C++, C#, Fortran, Java, Matlab, etc.

Reply   Post New Thread
 
Thread Tools Display Modes
  #1  
Old 04-02-2010, 02:56 AM
FUNJOKE FUNJOKE is offline
Junior Member
 
Join Date: Feb 2009
Posts: 11
Default data memory single cycle processor mips verilog code

library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;
entity DataMEM is
port(datain,address: in std_logic_vector(31 downto 0);
CLK,wrtenb,readenb: in std_logic;
dataout: out std_logic_vector(31 downto 0));
end DataMEM;
architecture behav_DataMEM of DataMEM is
type MEM_type is array(1023 downto 0) of std_logic_vector (7 downto 0);
signal data_mem : MEM_type;
begin
process(CLK,address)
begin
if (CLK' event and CLK='1' and wrtenb='1') then
data_mem(conv_integer(address)+3) <= datain(31 downto 24);
data_mem(conv_integer(address)+2) <= datain(23 downto 16);
data_mem(conv_integer(address)+1) <= datain(15 downto 8;
data_mem(conv_integer(address)) <= datain(7 downto 0);
end if;
if (readenb='1')then
dataout(31 downto 24) <= data_mem(conv_integer(address)+3);
dataout(23 downto 16) <= data_mem(conv_integer(address)+2);
dataout(15 downto 8<= data_mem(conv_integer(address)+1);
dataout(7 downto 0) <= data_mem(conv_integer(address));
end if;
end process;
end behav_DataMEM;


#anybody know how to write verilog code of data memory for single cycle processor ?i have the code in VHDL.i wan convert to verilog code,can help ?
Reply With Quote
Reply   Post New Thread

Tags
, , , , , , ,


Related Site Pages
Section Title
Worksheet Memory devices
Textbook Microprocessors : Principles Of Digital Computing
Textbook Finite-state machines : Principles Of Digital Computing
Textbook Modern nonmechanical memory : Digital Storage (memory)
Video Lecture Representative System (Part 1) - Microprocessors
Video Lecture Representative System (Part 3) - Executing a Program - Microprocessors
Video Lecture Representative System (Part 4) - Computer Software - Microprocessors
Video Lecture Microprocessor Internal Structure - Microprocessors
Video Lecture Microprocessor bus Networks - Microprocessors
Textbook Fundamentals of SPICE programming : Using The spice Circuit Simulation Program


Similar Threads
Thread Thread Starter Forum Replies Last Post
i need ADC PIC18F4550 code for single channel analog input cyril666 Embedded Systems and Microcontrollers 0 02-22-2009 06:01 AM
Reading from PIC18F2585 Data Memory using C 101 Embedded Systems and Microcontrollers 0 06-20-2008 08:09 PM
Writing VB code for reading data from uC kevy Programmer's Corner 3 12-02-2006 09:46 AM
Sample code for incoming IR data processing? nutcrack Programmer's Corner 3 07-29-2006 06:08 AM

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:57 PM.


User-posted content, unless source quoted, is licensed under a Creative Commons Public Domain License.
Powered by vBulletin
Copyright ©2000 - 2014, vBulletin Solutions, Inc.