Digital Design: An Embedded Systems Approach Using Verilog

Similar documents
Chapter 5 :: Memory and Logic Arrays

Modeling Sequential Elements with Verilog. Prof. Chien-Nan Liu TEL: ext: Sequential Circuit

ECE 451 Verilog Exercises. Sept 14, James Barnes

Registers & Counters

More Verilog. 8-bit Register with Synchronous Reset. Shift Register Example. N-bit Register with Asynchronous Reset.

RAM & ROM Based Digital Design. ECE 152A Winter 2012

Memory Basics. SRAM/DRAM Basics

Computer organization

1. Memory technology & Hierarchy

Lab #5: Design Example: Keypad Scanner and Encoder - Part 1 (120 pts)

Chapter 7: Advanced Modeling Techniques

Sequential Circuit Design

Memory. The memory types currently in common usage are:

Memory Elements. Combinational logic cannot remember

Memory unit. 2 k words. n bits per word

A N. O N Output/Input-output connection

Module 2. Embedded Processors and Memory. Version 2 EE IIT, Kharagpur 1

ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-17: Memory organisation, and types of memory

CHAPTER 7: The CPU and Memory

A New Paradigm for Synchronous State Machine Design in Verilog

Technical Note. Micron NAND Flash Controller via Xilinx Spartan -3 FPGA. Overview. TN-29-06: NAND Flash Controller on Spartan-3 Overview

Asynchronous Counters. Asynchronous Counters

Design of Digital Circuits (SS16)

Chapter 7 Memory and Programmable Logic

Lecture-3 MEMORY: Development of Memory:

Modeling Registers and Counters

SPI Flash Programming and Hardware Interfacing Using ispvm System

Life Cycle of a Memory Request. Ring Example: 2 requests for lock 17

Memory Testing. Memory testing.1

Introduction to Programmable Logic Devices. John Coughlan RAL Technology Department Detector & Electronics Division

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

LAB #4 Sequential Logic, Latches, Flip-Flops, Shift Registers, and Counters

Cascaded Counters. Page 1 BYU

Computer Architecture

Logical Operations. Control Unit. Contents. Arithmetic Operations. Objectives. The Central Processing Unit: Arithmetic / Logic Unit.

Lesson 10: Video-Out Interface

Computer Systems Structure Main Memory Organization

Chapter 9 Semiconductor Memories. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan

Topics of Chapter 5 Sequential Machines. Memory elements. Memory element terminology. Clock terminology

Digital Systems Based on Principles and Applications of Electrical Engineering/Rizzoni (McGraw Hill

The Central Processing Unit:

Understanding Verilog Blocking and Non-blocking Assignments

ECE410 Design Project Spring 2008 Design and Characterization of a CMOS 8-bit Microprocessor Data Path

Chapter 9 Latches, Flip-Flops, and Timers

ECE232: Hardware Organization and Design. Part 3: Verilog Tutorial. Basic Verilog

路 論 Chapter 15 System-Level Physical Design

A low-cost, connection aware, load-balancing solution for distributing Gigabit Ethernet traffic between two intrusion detection systems

Computers. Hardware. The Central Processing Unit (CPU) CMPT 125: Lecture 1: Understanding the Computer

Qsys and IP Core Integration

Introduction to CMOS VLSI Design (E158) Lecture 8: Clocking of VLSI Systems

VHDL GUIDELINES FOR SYNTHESIS

Modeling Latches and Flip-flops

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

Digital Design Verification

MAX II ISP Update with I/O Control & Register Data Retention

Engr354: Digital Logic Circuits

1 Gbit, 2 Gbit, 4 Gbit, 3 V SLC NAND Flash For Embedded

7a. System-on-chip design and prototyping platforms

Von der Hardware zur Software in FPGAs mit Embedded Prozessoren. Alexander Hahn Senior Field Application Engineer Lattice Semiconductor

Finite State Machine Design and VHDL Coding Techniques

5 Combinatorial Components. 5.0 Full adder. Full subtractor

Manchester Encoder-Decoder for Xilinx CPLDs

A Practical Parallel CRC Generation Method

To design digital counter circuits using JK-Flip-Flop. To implement counter using 74LS193 IC.

Chapter 6. Inside the System Unit. What You Will Learn... Computers Are Your Future. What You Will Learn... Describing Hardware Performance

(1) D Flip-Flop with Asynchronous Reset. (2) 4:1 Multiplexor. CS/EE120A VHDL Lab Programming Reference

SOLVING HIGH-SPEED MEMORY INTERFACE CHALLENGES WITH LOW-COST FPGAS

Vending Machine using Verilog

With respect to the way of data access we can classify memories as:

HT1632C 32 8 &24 16 LED Driver

A Verilog HDL Test Bench Primer Application Note

Open Flow Controller and Switch Datasheet

University of Toronto Faculty of Applied Science and Engineering

NB3H5150 I2C Programming Guide. I2C/SMBus Custom Configuration Application Note

EE 459/500 HDL Based Digital Design with Programmable Logic. Lecture 16 Timing and Clock Issues

Homework # 2. Solutions. 4.1 What are the differences among sequential access, direct access, and random access?

SDRAM and DRAM Memory Systems Overview

ESP-CV Custom Design Formal Equivalence Checking Based on Symbolic Simulation

Power Reduction Techniques in the SoC Clock Network. Clock Power

Computer Organization. and Instruction Execution. August 22

Digital Systems Design! Lecture 1 - Introduction!!

Memory ICS 233. Computer Architecture and Assembly Language Prof. Muhamed Mudawar

Design of a High Speed Communications Link Using Field Programmable Gate Arrays

CHAPTER 3 Boolean Algebra and Digital Logic

Using Altera MAX Series as Microcontroller I/O Expanders

Chapter 13: Verification

a8251 Features General Description Programmable Communications Interface

Avalon Interface Specifications

Read-only memory Implementing logic with ROM Programmable logic devices Implementing logic with PLDs Static hazards

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

Chapter 2 Basic Structure of Computers. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan

Memory Systems. Static Random Access Memory (SRAM) Cell

An Integer Square Root Algorithm

LatticeECP3 High-Speed I/O Interface

CSE2102 Digital Design II - Topics CSE Digital Design II

Prototyping ARM Cortex -A Processors using FPGA platforms

CHAPTER IX REGISTER BLOCKS COUNTERS, SHIFT, AND ROTATE REGISTERS

Sequential Circuits. Combinational Circuits Outputs depend on the current inputs

All Programmable Logic. Hans-Joachim Gelke Institute of Embedded Systems. Zürcher Fachhochschule

Transcription:

Digital Design: An Embedded Systems Approach Using Verilog Chapter 5 Memories Portions of this work are from the book, Digital Design: An Embedded Systems Approach Using Verilog, by Peter J. Ashenden, published by Morgan Kaufmann Publishers, Copyright 2007 Elsevier Inc. All rights reserved.

General Concepts A memory is an array of storage locations Each with a unique address Like a collection of registers, but with optimized implementation Address is unsigned-binary encoded n address bits 2 n locations All locations the same size 2 n m bit memory 0 1 2 3 4 5 6 2 n 2 2 n 1 m bits Digital Design Chapter 5 Memories 2

Memory Sizes Use power-of-2 multipliers Kilo (K): 2 10 = 1,024 10 3 Mega (M): 2 20 = 1,048,576 10 6 Giga (G): 2 30 = 1,073,741,824 10 9 Example 32K 32-bit memory Capacity = 1,024K = 1Mbit Requires 15 address bits Size is determined by application requirements Digital Design Chapter 5 Memories 3

Basic Memory Operations n m m a inputs: unsigned address d_in and d_out Type depends on application Write operation en = 1, wr = 1 d_in value stored in location given by address inputs Read operation en = 1, wr = 0 d_out driven with value of location given by address inputs Idle: en = 0 Digital Design Chapter 5 Memories 4

Wider Memories Memory components have a fixed width E.g., 1, 4, 8, 16,... Use memory components in parallel to make a wider memory E.g, three 16K 16 components for a 16K 48 memory Digital Design Chapter 5 Memories 5

More Locations To provide 2 n locations with 2 k -location components Use 2 n /2 k components Address A at offset A mod 2 k least-significant k bits of A in component A/2 k most-significant n k bits of A decode to select component 0 1 2 k 1 2 k 2 k +1 2 2 k 1 2 2 k 2 2 k +1 3 2 k 1 2 n 2 k 2 n 2 k +1 2 n 1 Digital Design Chapter 5 Memories 6

More Locations Example: 64K 8 memory composed of 16K 8 components Digital Design Chapter 5 Memories 7

Memory Types Random-Access Memory (RAM) Can read and write Static RAM (SRAM) Stores data so long as power is supplied Asynchronous SRAM: not clocked Synchronous SRAM (SSRAM): clocked Dynamic RAM (DRAM) Needs to be periodically refreshed Read-Only Memory (ROM) Combinational Programmable and Flash rewritable Volatile and non-volatile Digital Design Chapter 5 Memories 8

Asynchronous SRAM Data stored in 1-bit latch cells Address decoded to enable a given cell Usually use active-low control inputs Not available as components in ASICs or FPGAs Digital Design Chapter 5 Memories 9

Asynch SRAM Timing Timing parameters published in data sheets Access time From address/enable valid to data-out valid Cycle time From start to end of access Data setup and hold Before/after end of WE pulse Makes asynch SRAMs hard to use in clocked synchronous designs Digital Design Chapter 5 Memories 10

Example Data Sheet Digital Design Chapter 5 Memories 11

Synchronous SRAM (SSRAM) Clocked storage registers for inputs address, data and control inputs stored on a clock edge held for read/write cycle Flow-through SSRAM no register on data output a 1 xx a 2 xx M(a 2 ) Digital Design Chapter 5 Memories 12

Pipelined SSRAM Data output also has a register More suitable for high-speed systems Access RAM in one cycle, use the data in the next cycle a 1 a 2 xx xx M(a 2 ) Digital Design Chapter 5 Memories 13

Memories in Verilog RAM storage represented by an array variable reg [15:0] data_ram [0:4095];... always @(posedge clk) if (en) if (wr) begin data_ram[a] <= d_in; d_out <= d_in; end else d_out <= data_ram[a]; Digital Design Chapter 5 Memories 14

Example: Coefficient Multiplier module scaled_square ( output reg signed [7:-12] y, input signed [7:-12] c_in, x, input [11:0] i, input start, input clk, reset ); wire c_ram_wr; reg c_ram_en, x_ce, mult_sel, y_ce; reg signed [7:-12] c_out, x_out; reg signed [7:-12] c_ram [0:4095]; reg signed [7:-12] operand1, operand2; parameter [1:0] step1 = 2'b00, step2 = 2'b01, step3 = 2'b10; reg [1:0] current_state, next_state; assign c_ram_wr = 1'b0; Digital Design Chapter 5 Memories 15

Example: Coefficient Multiplier always @(posedge clk) // c RAM - flow through if (c_ram_en) if (c_ram_wr) begin c_ram[i] <= c_in; c_out <= c_in; end else c_out <= c_ram[i]; always @(posedge clk) // y register if (y_ce) begin if (!mult_sel) begin operand1 = c_out; operand2 = x_out; end else begin operand1 = x_out; operand2 = y; end y <= operand1 * operand2; end Digital Design Chapter 5 Memories 16

Example: Coefficient Multiplier always @(posedge clk) // State register... always @* // Next-state logic... always @* begin // Output logic... endmodule Digital Design Chapter 5 Memories 17

Pipelined SSRAM in Verilog reg pipelined_en; reg [15:0] pipelined_d_out;... always @(posedge clk) begin if (pipelined_en) d_out <= pipelined_d_out; pipelined_en <= en; if (en) if (wr) begin data_ram([a] <= d_in; pipelined_d_out <= d_in; end else pipelined_d_out <= data_ram[a]; end output register SSRAM Digital Design Chapter 5 Memories 18

Example: RAM Core Generator Digital Design Chapter 5 Memories 19