RTUEE / EC / EEEYr 2019 · Sem 72019

Q10VHDL

Question

16 marks

5. (a) What is memory organization? Explain 6T SRAM in detail. [8]

(b) How external devices are interfaced with CPU? Explain in detail. [8]

Answer

(a) Memory Organization and 6T SRAM Cell

6T SRAM CellM1(pull-up)M2(pull-down)M3M4cross-coupledM5 (access)M6 (access)BLBL'Word Line (WL)

As discussed in relation to the alternate paper's Unit V question, memory organization in VHDL is defined using an array data type, where each array element represents an addressable memory word, with clocked read/write processes modeling the actual synchronous or asynchronous access timing behavior of the target memory device.

The 6T (six-transistor) SRAM cell is the standard circuit used to implement one bit of storage in a static RAM array. It consists of two cross-coupled CMOS inverters (four transistors total: M1/M2 forming one inverter, M3/M4 forming the other), each inverter's output feeding the other's input, creating a bistable latch that holds its stored bit value indefinitely as long as power is supplied, without needing periodic refresh (unlike DRAM, whose single-transistor-per-bit cell relies on a small storage capacitor that must be periodically refreshed to prevent charge leakage from losing the stored value). Two additional access transistors (M5 and M6) connect the cell's two internal storage nodes to a pair of complementary bit lines (BL and BL'), with their gates controlled by a common word line (WL) - when WL is asserted (activating the access transistors), the cell's stored value can be read (by sensing a small differential voltage that develops on the bit lines, amplified by a sense amplifier) or written (by driving the bit lines to the desired value and its complement with sufficient drive strength to overpower and flip the cell's existing cross-coupled state, if different from the value being written).

The 6T SRAM cell's key advantages over DRAM's simpler 1-transistor-1-capacitor cell are much faster access time (since reading a strongly-driven, actively-latched bistable value is faster than sensing a small, passively-stored capacitor charge) and no need for periodic refresh circuitry, but at the cost of significantly larger cell area (six transistors versus one transistor plus one capacitor) and correspondingly much lower achievable storage density and higher cost per bit - this fundamental area/speed trade-off is precisely why SRAM is used for small, high-speed memories (CPU caches, register files) while DRAM is used for large, high-capacity main memory where cost per bit and density matter more than the fastest possible access time.

(b) Interfacing External Devices with CPU

External devices (peripherals such as keyboards, displays, storage devices, and sensors) are interfaced with a CPU through an I/O interface circuit (commonly called an I/O port or peripheral interface adapter), which bridges the electrical, timing, and protocol differences between the CPU's internal bus and the specific external device's own signal requirements. Two principal addressing schemes are used: memory-mapped I/O, in which peripheral device registers are assigned addresses within the same overall address space as main memory, allowing the CPU to access peripherals using its ordinary memory-read/memory-write instructions without needing any dedicated I/O instructions; and isolated (port-mapped) I/O, in which peripherals occupy a separate, distinct I/O address space accessed only through dedicated I/O instructions (such as the x86 architecture's IN and OUT instructions), with a separate control signal distinguishing an I/O-space access from an ordinary memory access on the shared address/data bus.

Data transfer between the CPU and an external device is typically managed using one of three techniques: programmed I/O (the CPU actively executes instructions to poll a device's status register repeatedly until it signals readiness, then transfers data directly through CPU registers, simple to implement but wasteful of CPU processing time spent polling); interrupt-driven I/O (the peripheral device itself asserts an interrupt request signal to the CPU only when it is actually ready for a data transfer, allowing the CPU to perform other useful work in the meantime rather than continuously polling, and only briefly pausing to service the interrupt when genuinely needed); and Direct Memory Access (DMA), in which a dedicated DMA controller hardware block is given control of the system bus to transfer entire blocks of data directly between the peripheral device and main memory without requiring the CPU's continuous involvement at all (the CPU only sets up the transfer parameters beforehand and receives a single completion interrupt afterward), the most efficient of the three techniques for transferring large blocks of data, since it frees the CPU almost entirely from involvement in the actual data movement, and is the standard technique used for high-throughput peripherals such as disk drives, network interfaces, and high-speed data acquisition systems.

The 6T SRAM cell design and the CPU interfacing techniques discussed in this question connect through the practical reality of how a CPU actually accesses external memory-mapped or isolated-I/O devices at the electrical and timing level: whether a peripheral's registers are accessed via memory-mapped or isolated I/O, the CPU's bus-access cycle must still respect the read/write access timing of whatever storage technology (SRAM, or a peripheral's internal registers built from similar bistable storage elements) sits behind that address, meaning that the SRAM access-timing characteristics discussed above (the need to assert the word line, allow the bit-line differential to develop, and then correctly sense or drive the stored value) are directly relevant to how fast a CPU can actually complete a bus cycle to a given memory-mapped address, and slower memory technologies typically require the CPU's bus controller to insert wait states to avoid violating the memory's access-time requirements.

The choice between programmed I/O, interrupt-driven I/O, and DMA also interacts with whether a peripheral device behaves more like fast, synchronous SRAM-style storage or like a slow, asynchronous mechanical or electromechanical device: a fast peripheral capable of immediate response (similar in spirit to SRAM's fast access) is often well suited to simple programmed I/O without excessive CPU time wasted polling, whereas a slow peripheral (a mechanical printer, or a disk drive with substantial seek latency) is far better served by interrupt-driven I/O or DMA, precisely because the large mismatch between CPU processing speed and the peripheral's much slower response time would otherwise waste enormous numbers of CPU cycles in a simple polling loop - the underlying engineering principle in both the memory-technology and I/O-technique discussions here is the same: matching the interfacing technique's overhead and latency characteristics appropriately to the actual speed of the device being accessed.

Finally, both sub-topics in this question - SRAM cell design and CPU/peripheral interfacing - are unified by the same underlying concern that runs throughout this examination's memory and interfacing questions: correctly matching a control or interconnection scheme's timing and complexity to the actual physical or electrical characteristics of the device being accessed, whether that means choosing 6T SRAM over DRAM for a fast cache, or choosing DMA over programmed I/O for a high-throughput peripheral, both being applications of the same general engineering principle of aligning interfacing overhead with the true performance requirements and constraints of the underlying hardware.

Back to Paper