Memory Supplement for Section 3.6 of the textbook

Similar documents
Memory Devices. Future?

Picture of memory. Word FFFFFFFD FFFFFFFE FFFFFFFF

Memory, Latches, & Registers

Random Access Memory (RAM)

CS429: Computer Organization and Architecture

Memory, Latches, & Registers

Concept of Memory. The memory of computer is broadly categories into two categories:

BUILDING BLOCKS OF A BASIC MICROPROCESSOR. Part 1 PowerPoint Format of Lecture 3 of Book

Topic #6. Processor Design

The Memory Hierarchy Part I

Overview. Memory Classification Read-Only Memory (ROM) Random Access Memory (RAM) Functional Behavior of RAM. Implementing Static RAM

Chapter 5 Internal Memory

ECE260: Fundamentals of Computer Engineering

Chapter 6 (Lect 3) Counters Continued. Unused States Ring counter. Implementing with Registers Implementing with Counter and Decoder

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Building Memory

Reference Sheet for C112 Hardware

William Stallings Computer Organization and Architecture 6th Edition. Chapter 5 Internal Memory

10/24/2016. Let s Name Some Groups of Bits. ECE 120: Introduction to Computing. We Just Need a Few More. You Want to Use What as Names?!

Chapter 4 Main Memory

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 2, 2016

Organization. 5.1 Semiconductor Main Memory. William Stallings Computer Organization and Architecture 6th Edition

Number Systems and Computer Arithmetic

Computer Organization. 8th Edition. Chapter 5 Internal Memory

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 3, 2015

Chapter 8 Memory Basics

Logic and Computer Design Fundamentals. Chapter 8 Memory Basics

Memory and Programmable Logic

Basic Organization Memory Cell Operation. CSCI 4717 Computer Architecture. ROM Uses. Random Access Memory. Semiconductor Memory Types

Lab #12: ArithmeticLogic Unit

Topic Notes: Building Memory

falling edge Intro Computer Organization

Internal Memory. Computer Architecture. Outline. Memory Hierarchy. Semiconductor Memory Types. Copyright 2000 N. AYDIN. All rights reserved.

UNIT - V MEMORY P.VIDYA SAGAR ( ASSOCIATE PROFESSOR) Department of Electronics and Communication Engineering, VBIT

Summer 2003 Lecture 18 07/09/03

Announcements. This week: no lab, no quiz, just midterm

SAE5C Computer Organization and Architecture. Unit : I - V

EECS 3201: Digital Logic Design Lecture 7. Ihab Amer, PhD, SMIEEE, P.Eng.

Single Cycle Datapath

Digital Logic the Bare Minimum

Infineon HYB39S128160CT M SDRAM Circuit Analysis

CREATED BY M BILAL & Arslan Ahmad Shaad Visit:

Memory. Outline. ECEN454 Digital Integrated Circuit Design. Memory Arrays. SRAM Architecture DRAM. Serial Access Memories ROM

For Example: P: LOAD 5 R0. The command given here is used to load a data 5 to the register R0.

Chapter 4. The Processor

CENG 3420 Computer Organization and Design. Lecture 06: MIPS Processor - I. Bei Yu

Introduction to Semiconductor Memory Dr. Lynn Fuller Webpage:

EE 3170 Microcontroller Applications

Topics of this Slideset. CS429: Computer Organization and Architecture. Digital Signals. Truth Tables. Logic Design

The Memory Component

6. Latches and Memories

Chapter 2 Logic Gates and Introduction to Computer Architecture

CS250 VLSI Systems Design Lecture 9: Memory

Memories. Design of Digital Circuits 2017 Srdjan Capkun Onur Mutlu.

Sense Amplifiers 6 T Cell. M PC is the precharge transistor whose purpose is to force the latch to operate at the unstable point.

Microprocessor Architecture. mywbut.com 1

IA Digital Electronics - Supervision I

Chapter 4. The Processor. Instruction count Determined by ISA and compiler. We will examine two MIPS implementations

6.1 Combinational Circuits. George Boole ( ) Claude Shannon ( )

MICROPROCESSOR AND MICROCONTROLLER BASED SYSTEMS

CSEE 3827: Fundamentals of Computer Systems. Storage

EECS150 - Digital Design Lecture 17 Memory 2

The Processor: Datapath and Control. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

ENGIN 112 Intro to Electrical and Computer Engineering

ECSE-2610 Computer Components & Operations (COCO)

The D igital Digital Logic Level Chapter 3 1

Single Cycle Data Path

6.1 Combinational Circuits. George Boole ( ) Claude Shannon ( )

BUS TIMING ANALYSIS. George E Hadley, Timothy Rogers, and David G Meyer 2018, Images Property of their Respective Owners

Register Transfer and Micro-operations

CS24: INTRODUCTION TO COMPUTING SYSTEMS. Spring 2017 Lecture 13

Very Large Scale Integration (VLSI)

Semiconductor Memory Classification

COSC 243. Computer Architecture 1. COSC 243 (Computer Architecture) Lecture 6 - Computer Architecture 1 1

COMPUTER ORGANIZATION AND DESIGN

MEMORY AND PROGRAMMABLE LOGIC

ECE 485/585 Microprocessor System Design

Memory System Overview. DMA & Endian-ness. Technology. Architectural. Problem: The Memory Wall

Chapter 4. The Processor

REGISTER TRANSFER LANGUAGE

CS152 Computer Architecture and Engineering Lecture 16: Memory System

ECE 485/585 Microprocessor System Design

Lecture 11 SRAM Zhuo Feng. Z. Feng MTU EE4800 CMOS Digital IC Design & Analysis 2010

ECE369. Chapter 5 ECE369

ECE 2300 Digital Logic & Computer Organization

ECE 152 Introduction to Computer Architecture

Memory Basics. Course Outline. Introduction to Digital Logic. Copyright 2000 N. AYDIN. All rights reserved. 1. Introduction to Digital Logic.

ESE370: Circuit-Level Modeling, Design, and Optimization for Digital Systems

Chapter 4. The Processor

ECE 331: N0. Professor Andrew Mason Michigan State University. Opening Remarks

What s a Tri-state Buffer?

DP8420V 21V 22V-33 DP84T22-25 microcmos Programmable 256k 1M 4M Dynamic RAM Controller Drivers

Processor (I) - datapath & control. Hwansoo Han

Microcomputers. Outline. Number Systems and Digital Logic Review

Unit 6 1.Random Access Memory (RAM) Chapter 3 Combinational Logic Design 2.Programmable Logic

+1 (479)

Chapter Two - SRAM 1. Introduction to Memories. Static Random Access Memory (SRAM)

The 80C186XL 80C188XL Integrated Refresh Control Unit

Marching Memory マーチングメモリ. UCAS-6 6 > Stanford > Imperial > Verify 中村維男 Based on Patent Application by Tadao Nakamura and Michael J.

COMP3221: Microprocessors and. and Embedded Systems. Overview. Lecture 23: Memory Systems (I)

Chapter 3 - Top Level View of Computer Function

Transcription:

The most basic -bit memory is the SR-latch with consists of two cross-coupled NOR gates. R Recall the NOR gate truth table: A S B (A + B) The S stands for Set to remember, and the R for Reset to remember. For example, if the input values of R = and S = are held constant, then the bottom NOR gate will start outputting. This is fed as an input to the upper NOR with the R =, so both of the upper NOR gate s inputs are. Thus, the upper NOR gate will start outputting a which is fed back to the bottom NOR as an input. Now, the bottom NOR has an input of two s, but it continues to output a because that s what NORs do (see truth table). If the S input s value is now changed back to (both R = and S=), then bottom NOR will continue to output (i.e., = ) since the top NOR is still outputting a. The top NOR has two inputs, so it continues to output (i.e., = ). This is a stable state where the SR-latch is remembering a. A timing diagram for the above scenario would look like: R S one gate delay one gate delay time. Initial state of R = and S =. After a gate delay, the bottom NOR outputs a which is fed to the upper NOR (the upper NOR has two s for inputs) 3. After a gate delay, the top NOR outputs a which is fed to the bottom NOR (the bottom NOR has two s for inputs) 4. When S returns to, no change in outputs The SR-latch is actual symmetric from top-to-bottom, so a similar argument can be made for the inputs of R = and S = causing a stable state of it remembering a. The main problem with the SR-latch is that its output changes are determined by some number of gate delays after its inputs are changed. This makes it difficult for a collection of one-bit memories to work in a lock-step fashion to hold a multiple bit value. It also has the problem that inputs of R = and S = lead to an undefined state. Memory Supplement - Page

We can solve these problems in a series of steps. First we ll add a input to prevent the memory from changing states if the =. This leads us to a clocked-sr latch: R S R' S' Original SR-latch When the =, both AN gates will output s. This guarantees that the original SR-latch has inputs of R = and S =, so it cannot change its memory state. When the =, the AN gates allow the R and S inputs to be passed through without change. This does not exactly solve either of the previously mentioned problems, but we can at least prevent the clocked-sr latch from changing by having the =. To solve the problem of inputs of R = and S = leading to an undefined state. We ll consider a slightly different clocked latch called a clocked -latch. The clocked -latch remembers the value on the input when the =. If the =, then the input is ignored and the one-bit memory is not changed. The clocked -latch circuit is very similar to the clocked SR latch. R' S' Original SR-latch To fix the problem of the one-bit memory having its output changing being determined by some number of gate delays after its inputs are changed. We can use two clocked -latches to build a Master-Slave flip-flop which changes state only on the falling edge of the clock pulse. The below timing diagram shows how the internal clocked -latches change within the master-slave flip-flop to achieve this. When the =, the master -latch can change to s value, but the slave -latch cannot change since it receives the negated signal of. When the =, the master -latch cannot change, but the slave -latch can change to remember the value being remembered in the master -latch ( m ). Memory Supplement - Page

m s Clk Clk time = m s The value of only changes on the falling-edge of the This master-slave flip-flop allows for a collection of one-bit memories to work in a lock-step fashion to hold a multiple bit value. The value currently contained in a flip-flop can to read (from the slave s ) in the same clock pulse as a new value is written to it (into the master s input). The following block diagram shows how four flip-flops can be used to load and read 4-bit value in parallel. The triangle input of each flip-flop connected to the Load wire is the input in the above diagram. This triangle input indicates that a flip-flop is being used instead of a latch. ata to Write in Parallel Load ata to Read in Parallel Memory Supplement - Page 3

Another more complex example would be a shift-register that allows the value stored in the register to also be shifted by one bit position several ways. The below diagram is a 4-bit shift-register that is able to perform the following operations: parallel read/output of all bits (just look at the values) (Control of ) parallel write/input of all bits (Control of ) logical shift left one bit position (value shifted out of most-significant bit is lost and a is shifted into the least-significant bit) (Control of ) circular shift right one bit position (value shifted out of least-significant bit is shifted into the most-significant bit) (Control of ) arithmetic shift right (sign-extend the most-significant bit) For each -flip flop, the output of a MUX is used as the -input. The Control wires control the MUXs to vary the value routed to the inputs. ata to Write in Parallel Control Load 3 3 3 3 MUX MUX MUX MUX ata to Read in Parallel Register File: Computers typically have a collection of registers, called a register file, to store data values currently being calculated with by the CPU. Individual registers are numbered (register or R, register or R, etc.) and assigned by the compiler or the assembly-language programmer to hold variable values. Since most arithmetic operations need two operands (e.g., addition: Y + Z), most register files have at least two read/output ports and one write/input port to accommodate sending two values to the ALU and receiving one result. Memory Supplement - Page 4

CPU/Processor ALU (+,-,*, etc) write port R R R Register File read ports R3 To control each read port we need to be able to specify a register number for the register to be read. The width/number of bits read equals the number of bits per register. For example, 3 register (R to R3) need 5-bits to represent this range of values to, i.e., to 3. To control a write port we need to be able to specify a register number for the register to be written, the data to be written (equal to the number of bits in a register), and a write-enable signal. The write-enable signal indicates if we are writing a register, i.e., indicates if we should ignore the write register # and data. A register-file block-diagram assuming: 3 registers numbered R to R3 ( to in binary) 64-bit registers two read ports one write port Memory Supplement - Page 5

Register File 5 bits Reg. # for Read Port ata Read from Read Port 64 bits 5 bits Reg. # for Read Port ata Read from Read Port 64 bits 5 bits 64 bits bit Reg. # for Write Port Write ata for Write Port Write Enable One-bit (i th bit) Slice of a Register File Implementation Using -latches: The diagram below shows only a one-bit slice for the i th bit of the register file to simplify the diagram. The write-port register number (5-bit number from R to R3) is input to a decoder to wake-up the corresponding register to be written by sending a into the clock signal for register to be written. The decoder sends s to all the other registers clock signals. Notice that the selected register only receives the from the decoder if the write-enable signal is also a. When a register is read at a read-port, the whole register is read in parallel (i.e., all 64-bits at the same time). For example, 64-bit registers requires 64 data wires of output. Each output wire is fed by a multiplexer which uses the register number to be read as its Control to select the bit from the appropriate register. In this example 64 MUXs each with 3-inputs (one for each register) are need per read port. Since we have two read ports, a total of 8 MUXs would be needed. Memory Supplement - Page 6

Reg. # for Read Port 5 bits th i Bit Reg. # for Write Port 5 bits ata for Write Port 64 bits Write Enable bit ecoder 5-to-3 3 th i bit R R R3 3. MUX 3-to-. th i bit of 64 bits Read Port Note: To write a flip-flop, we want its reg. # to be specified and the "Write Enable" to be asserted. Note: 64 MUXs are need per Read Port - one per bit Memory Supplement - Page 7

To help clarify the above discussion, a complete (not just a one-bit slice) register file that has: 4 registers (numbered R to R3, i.e., register numbers to ) -bits per register one write-port two read-ports Reg. # for Read Port bits MSB LSB R 3 MUX 4-to- MSB Read Port Reg. # for Write Port bits ecoder -to-4 3 R 3 MUX 4-to- LSB Read Port ata for Write Port bits MSB LSB R 3 MUX 4-to- MSB Read Port Write Enable bit R3 3 MUX 4-to- LSB Read Port Reg. # for Read Port bits Figure 3.3 on page 43 is a similar to the above picture, except it is for a 4 word x 3 bit memory. Memories unlike register files typically have only a single combined read/write port. So only a read or a write can be performed at the same time. That s why Figure 3.3 has only one set of address (S and S ) lines that act like the register # in the above diagram. Notice that Figure 3.3 shows the AN gates and OR gates need to implement the decoder (along the bottom) and the MUXs (along the right and above the flip-flops). Memory Supplement - Page 8

Implementation of Large Memory Chips: The above register-file design does not scale well for large (realistic) memories for several reasons: the number of gates in the address decoder (and MUXs) grows exponentially with the number of bits in the address. lots of wires into/out of the memory for address, data, and control These problems are solved by using square-array of bits and decoding the address in two parts (row then column number) eliminate MUX's by using tri-state buffers single-port RAM memory - data wires shared for reading and writing, and one address specified Consider a larger memory with 4M word x 4-bit words, i.e., a 4M x 4 memory. This would have a -bit addresses since 4M =. Conceptually (logically/externally) we view a 4M x 4-bit memory as pictured below with: each memory word made up of four bits: b 3 b b b ecimal Address 3 b b b b 3. - When we want to write a word, we supply a -bit address and the corresponding new 4-bit word for that row. If we actually implemented this memory using a register-file design, we d need a -to- decoder for the write-port. If we think about how a decoder is implemented, each decoder output is fed by an AN gate looking for its corresponding address. Thus, we d need (or 4 M) -input AN gates. Since -input AN gates exceed the limit of 9-inputs or less for an AN, we would need to build each -input AN gate using 3 smaller ANs as: Memory Supplement - Page 9

(9 inputs) (9 inputs) (4 inputs) A total of 3 x AN gates are needed to implement just the write-port decoder. As in Figure 3.3, the read port could use the same decoder as the write port. Still, each bit in the memory requires a -input AN gate. Additionally, each of the four output wires is fed by a really BIG -input OR gate. Because of the 9-input limit, each -input OR must be implemented by multiple levels of smaller OR gates. The number of actual OR gates needed to implement each -input OR would be about: 9 + 9 + 9 +... + 3 = 54,89 The total for number of gates for the read port would be 4 x ANs + 4 x 54,89 ORs. Assuming -latches to store each bit of the memory, the total number of gates needed for storing all x 4 bits of memory is x 4 x 4 = 6 gates. Overall, the number of gates in the whole memory is about (3 x ) + (4 x + 4 x 54,89) + ( 6 ). Since the -latch gates are the only ones that are used for actually storage, the gates associated with the read and write ports can be considered overhead. The percentage of gates used for actual storage (the -latch gates) of bits is: 6 (3% )+(4% +4%54,89)+( 6 ) x = 68. % In practice memory s do not use SR-latch based -bit memories, called static memory, because each bit requires multiple gates per bit of storage (e.g., 4 gates per bit for a -latch). To increase the amount of memory on a, dynamic memory is used that only requires one gate per bit of storage. The one gate used in one bit of dynamic memory acts like a capacitor. You might recall from Physics that a capacitor is a device for storing a charge across two nearby plates. The electrons from one plate are forces from one plate to the other plate. Because the plates are insulated from each other, the charge is stored. The magnitude of the charge difference between the plates determines whether a is being stored (say a voltage difference of to volts) or a is being stored (say a voltage difference of to 5 volts) in the memory. ynamic memory (the in RAM) can store about four times more bits on a than static memory, but is also has some problems: reading the value being stored is relatively slow since the volt difference must be sensed to determine the binary value being stored. s are made from semiconductor material, so a dynamic-memory gate storing a with a high voltage difference (say 5 volts) will have electrons leak across the plates and eventually be storing a (voltage difference of ). To solve this problem, dynamic memory s must be refreshed which means that periodically the whole memory must be read and rewritten to boost the values up to a high voltage difference. Usually, the memory refreshing only takes a fraction of a percent of the memory s overall execution time. Memory Supplement - Page

If we recalculate the percentage of gates used for actual storage assuming dynamic memory (one gate per bit), we get: 4 (3% )+(4% +4%54,89)+( 4 ) x = 34.8 % Thus, 65. % of the gates on the are being wasted in overhead for decoding, MUXs, etc. To help us see how the 4M x 4-bit memory gets mapped to the 48 x 48 x 4 memory array on the next page consider splitting memory into 48 word blocks as shown below. Notice that the most-significant bits of the binary address correspond to the row number, and the least-significant bits of the address to the offset within the row. ecimal Address 3. 47 48 49. b b b b 3 Row Row Row Row Row Row Row Row Binary Address Row # Location in Row 495 496 497 498 499 Row Row Row Row. Row 47 Row 47 Row 47 Row 47 - Memory Supplement - Page

Each bit of a word is split into a separate 48 x 48 square memory array. Each of these square memory arrays is 48 x 48 = x = = 4M bits. The -bit address of the 4M memory is split into two -bit parts. The upper -bits is first used to activate the correct row within the square memory arrays. Of the 48-bit row that is read from each memory array, we are interested in only one bit. The lower -bits of the address specifies the location of the desired bit within the 48-bit row. Bit b Bit b Bit b Bit b 3 -to-48 ecoder -to-48 ecoder 47 47 Row Row Row Row 48 x 48 48 x 48 Row 47 Row 47 Sense Amplifier Amp & Amp & Sense Amplifier and I/O Gate I/O Gate I/O Gate and I/O Gate ata ata IB OB IB OB ata ata Input Output Input Output Buffer Buffer Buffer Buffer 3 -bit Address -bit Row # -bit Column # Note: This is a tri-state (three-state) buffer. It acts as a switch. When the "Control" is a In, the "In" signal is passed to the Control the "Out" wire. When the "Control" is a, the "In" is disconnected Out from the "Out" wire. Memory Supplement - Page

For this square-memory design of memory, we can recalculate the percentage of gates used for actual storage (the dynamic-memory capacitor gates) of bits. We now have two, smaller, -to- decoders. Each decoder output is fed by an AN-gate looking for its corresponding address. Thus, we d need (or K) -input AN gates. Since -input AN gates exceed the limit of 9-inputs or less for an AN, we would need to build each -input AN gate using smaller ANs as: (9 inputs) ( inputs) A total of x x = 3 AN gates are needed to implement both the row and column decoders. No MUXs are needed in the square-memory design, but we do need 4 x = 3 tri-state buffers. Assuming dynamic memory to store each bit of the memory, the total number of gates needed for storing all x 4 bits of memory is x 4 = 4 gates. Overall, the number of gates in the whole memory is about 3 + 3 + 4. For the square-memory design, the percentage of gates used for actual storage of bits is: 4 3 + 3 + 4 x = 99.9 % Thus, only about. % of the memory s capacity is wasted on overhead for decoding, MUX, etc. The square-memory design also offers a couple of other important benefits: when refreshing the memory, whole rows can be read and rewritten at a time so refreshing is relatively quick since whole rows are read from the slow dynamic memory at a time, a block of memory from contiguous memory locations can be read about as fast as a reading a single memory access. Thus, many real RAM memory s provide a fast-page mode or burst feature that allow accessing a block of memory efficiently. Memory Supplement - Page 3

Implementing Large Memory with Smaller Chips Consider for example, implementing 4M x 3 bits memory with 56KB x bit s. The 56KB x s are implemented as square arrays of 5 x 5. We will use an two-dimensional array of the 56KB x s to implement the larger memory. The number of s per row would be 3 bits / bit = 3 s. The number of s per column would be 4M / 56K = / 8 = 4 = 6 s per column. The -bit address of the 4M x 3 bit memory would be split up as follows: -bit Address Memory Supplement for Section 3.6 of the textbook 4 bits row 8 bits row # column # within within 9 bits 9 bits 3 s in a row 4 (time-multiplexed) 9 4-to-6 ecoder 5 5 x 5 Out 5 x 5 Out 5 x 5 5 x 5 Row of Chips Row of Chips 5 x 5 5 x 5 5 x 5 Out 5 x 5 Row 5 of Chips 5 x 5 "" means Chip Select b b b 3 3 Memory Supplement - Page 4