Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how u deign memory in verlog

Status
Not open for further replies.

shashi_reddy21

Junior Member level 3
Joined
Feb 9, 2005
Messages
26
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
213
how will u decide the how many address bits and data bits you should have while designing a 16k ram
 

shashi_reddy21 said:
how will u decide the how many address bits and data bits you should have while designing a 16k ram

This is same whether in verilog /vhdl or on hardware . Ok Lets assume we have a memory here with 2 bytes ..how many address lines would be needed ? 1 right .. if it is zero then choose one location if it is one choose the other one . What if the memory is 4 bytes .. u need 2 address bits 00 -> 1 byte ; 01 -> 2nd byte; 10 -> 3rd byte ; 11 -> fourth byte .What should this tell you with n bit address you will be able to access a memory of 2 to the power of n memory locations .

You have 16k byte ram => 16*1024 bytes of ram ( I hope you know 1kB = 1024 bytes) = 16384
You therefore need log to base 2 of 16*1024 address bits (which is 16 bits)
2 ^ 16 = 16384

Please brush up your basic digital electronics ... this is more to do with that :) ... No offence meant
 

Address Lines = log2meme-size
log216k=14
data lines=depends how many bits you can access simultaneously. Say if the memory is only used with 8-bit controller then 8 data lines are enough. You may choose two options
1. design the memroy such that any processor may access it in one cycle. (8 data lines)
2. design the memroy such that your intended processor may access it in one cycle.

However, the first one would be disadvantageus for the processor that can access more than one byte in one cycle as the power of the cpu wouldn't have been used properly and efficiently.
 

Any memory would require a memory definition and an address decoder. Regrardless of you use an HDL or design a circuit.
et's say for example in VHDL (as i use it more then Verilog) you need to define the width and length of memory using a 2-D array style and then write a counter which counts all locations in memory and call both of these components in a higher level wrapper to work as a product. if interested then let me know i will send you some simple memory code as well.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top