Memory and Programmable Logic

Learn how digital systems store data and how programmable chips implement logic. You will size a RAM and follow its read and write cycles, compare static and dynamic RAM, build memory arrays with decoders and combine chips into larger memories. You will protect stored words with parity and Hamming codes, implement functions with ROMs, PLAs and PALs, and see how FPGAs use lookup tables, flip-flops, programmable routing and embedded memory to hold whole designs.

BeginnerLesson 6 of 7 in Digital Logic Design Course

What you will learn

  1. Describe a random-access memory by its words, address lines and data lines, follow its read and write cycles in time, and compare static and dynamic RAM.
    • Describe a memory by its words, addresses and data lines
      Size a memory as words times bits, find the address and data lines it needs, and use its control inputs to read or write one word.
    • Follow read and write cycles in time
      Read memory timing diagrams, distinguish access time from cycle time, and count how many clock periods a processor must allow for each memory operation.
    • Compare static and dynamic RAM
      Explain how SRAM and DRAM keep their data, why DRAM needs refresh and sends its address in two halves, and where each type is used.
  2. Build a memory from storage cells and a decoder, cut the decoding logic with row and column selection, and combine chips into larger memories with a clear address map.
    • Build a small RAM from cells and a decoder
      Model a memory cell as a one-bit storage element with select and read/write control, and connect cells, a decoder and output gates into a word-organized array with one or more ports.
    • Select words with coincident (row and column) decoding
      Arrange cells in a two-dimensional array selected by a row decoder and a column decoder, locate a word from its address, and compare the decoder cost with linear decoding.
    • Combine memory chips into larger memories
      Widen words by placing chips side by side, add words with a decoder on the upper address bits, and work out the address range that each chip answers.
  3. Protect stored words with parity and Hamming codes: add check bits, find and correct a single-bit error, and detect double-bit errors.
    • Detect errors with a parity bit
      Generate and check even and odd parity, and explain which errors a single parity bit can and cannot detect.
    • Build a Hamming code word
      Find how many check bits a word needs, place them at the power-of-two positions, and compute each one from the positions it covers.
    • Locate and correct errors with the syndrome
      Recheck the parity groups of a word read from memory, read the result as the position of a single error, and add an overall parity bit to detect double errors.
  4. Describe how a ROM is built and which kinds exist, and implement a combinational circuit by storing its truth table in a ROM.
    • Describe ROM structure and types
      Explain a ROM as a decoder feeding programmable OR connections, find its size, and compare mask ROM, PROM, EPROM, EEPROM and flash.
    • Implement a combinational circuit with a ROM
      Turn a truth table into ROM contents, reduce the ROM size by spotting outputs that need no storage, and judge when a ROM is a sensible way to build a function.
  5. Program sum-of-products functions into programmable AND and OR arrays, work within each device's product-term limits, and add flip-flops for sequential designs.
    • Program a PLA
      Read programmable-logic array notation, size a PLA by its inputs, product terms and outputs, and write the programming table for a set of functions that share product terms.
    • Fit functions into a PAL
      Implement functions in a PAL's programmable AND array and fixed OR gates, respect the product-term limit of each output, and use feedback when a function needs more terms.
    • Add flip-flops: registered PLDs and CPLDs
      Explain how macrocells with flip-flops make programmable devices sequential, how a CPLD joins many PAL-like blocks, and how to choose among ROM, PLA, PAL, CPLD and FPGA.
  6. Explain how lookup tables, flip-flops, programmable routing and embedded blocks let an FPGA implement a design, and how that configuration is stored, loaded and produced.
    • Implement logic with lookup tables and logic blocks
      Explain a lookup table as a small memory that holds a truth table, fill one for a given function, split larger functions across several tables, and describe what a logic block adds.
    • Explain FPGA routing, embedded blocks and configuration
      Describe the programmable interconnect, input/output blocks, block RAM, DSP and clock resources, how the configuration is stored and loaded, and how a design is turned into a configuration.

Memory and Programmable Logic study guide

6 chapters

1

Size a RAM and follow its operations

A memory interface has to answer three questions: which word is selected, which bits move, and when they are safe to use. You will connect word counts to address lines, follow the signals during reads and writes, and turn memory timing into clock periods. SRAM and DRAM then show two ways to keep the same binary information, with different demands on the hardware that controls it.

1.1 Read memory sizes and select a word

A memory word is a group of bits stored and accessed together. Its address identifies its location; the address is separate from the value stored there. Writing a different value changes the word's contents, not its address.

Count words and bits separately

A 2k×n memory contains 2k words, each n bits wide. The k address lines choose one word. The n data lines carry all its bits together. Some chips have separate input and output data lines; others use one bidirectional set.

For a 64K×16 RAM, 64K means 64×1,024=65,536=216 words. It needs 16 address lines and 16 data lines. Its capacity is

65,536×16=1,048,576 bits.

Dividing by eight gives 131,072 bytes, or 128 KiB. The highest address is 65,535 because numbering starts at zero.

The binary prefixes Ki, Mi, and Gi explicitly mean powers of 1,024. Thus 1 KiB is 1,024 bytes, while 1 kB is 1,000 bytes. In memory word counts, K, M, and G conventionally mean 210, 220, and 230. Reading 64K as 64,000 gives a capacity about 2.3% too small.

Choose enough address patterns

Address lines depend on words, not total bits. Both a 1M×8 memory and a 1M×32 memory need 20 address lines. The second has wider data paths, not more locations.

For a word count that is not a power of two, choose the smallest whole number of lines that gives enough patterns. A 5,000-word memory needs 13 lines: 12 give only 4,096 addresses; 13 give 8,192. Some address patterns will be unused. In symbols, the line count is ⌈log⁡2W⌉ for W words.

Tell the chip what to do

Memory enable, also called chip select, activates the chip. A read/write input chooses the operation. One common active-high enable interface behaves as follows:

EnableRead/writeOperation
0EitherNo operation
10Write
11Read

Other interfaces use active-low signals such as CS‾, WE‾, and OE‾. Their asserted level is zero. Read the signal names and function table before assigning levels. An inactive chip normally releases its output pins into high impedance, so another chip can drive the shared data lines.

To write, apply an address and data, then activate the write control with the required timing. Writing 1010 at address 2 of a 4×4 RAM replaces only word 2. To read, apply address 2 and enable reading; the outputs provide a copy of 1010, and the stored word remains intact.

Random access means a word is reached directly from its address without stepping through earlier words. RAM is volatile and loses its contents without power; ROM is nonvolatile. A RAM can be pictured as registers plus a selection decoder, but its compact storage cells allow much greater capacity than a bank of ordinary flip-flops.

Key Takeaways

  • Capacity equals word count times bits per word.
  • Address lines select words; data lines carry a word.
  • K in a memory word count means 1,024; kB means 1,000 bytes.
  • Signal polarity determines which control level is active.
  • A read copies the selected word; a write replaces it.

1.2 Decide when memory data is ready

A correct address does not make data valid immediately. Memory operations take time, and the circuit using the memory must respect both the delay before data is ready and the interval before another operation may begin.

Access time and cycle time

Access time runs from applying a new address, with reading enabled, until the selected word is valid. Cycle time is the minimum interval between the starts of successive operations. Cycle time is at least as long as access time and may include extra recovery time.

Suppose access time is 25 ns and cycle time is 35 ns. A read started at time zero can supply valid data at 25 ns, but the next operation cannot start until 35 ns. Sampling the first word at 30 ns may work; starting a second operation then violates the cycle time. One nanosecond is 10−9 s.

Follow an asynchronous read

An asynchronous RAM has no clock input. It responds to its address and control signals. A processor may use its own clock to schedule those signals, but that does not turn the memory into a synchronous device.

Start by making the address stable and enabling the chip for reading. Wait until the specified access delay has elapsed. Only then capture the output bits. If the processor captures at 30 ns, a 25 ns access time meets that data-valid deadline; a 35 ns access time does not. The output can still show an old word or changing values before the deadline.

Follow an asynchronous write
  1. Apply the address and let it settle.
  2. Enable the chip and assert write.
  3. Keep the intended data stable for the required setup time before write ends.
  4. Keep it stable for the required hold time after write ends.
  5. Allow the complete cycle time before starting another operation.

Setup time is the required stable interval before the relevant event; hold time is the interval after it. The datasheet identifies that event and the address timing limits. Changing the address while write is active risks writing the wrong word or corrupting more than one location.

Convert timing into clock periods

At 100 MHz, a clock period is

T=1100×106 Hz=10 ns.

A 35 ns memory cycle spans 3.5 periods, so allow four whole periods, or 40 ns. Three periods provide only 30 ns. The required count is ⌈tcycle/T⌉: always round up. Check the data-capture time separately from the start-to-start cycle interval; meeting one does not establish the other.

Recognize a synchronous interface

A synchronous RAM samples address, data, and control on clock edges. Its latency specifies when a requested word becomes available in clock cycles. The device timing diagram identifies the edge associated with a result and the finite output delay after that edge. Optional output registers can add another cycle, so the controller must use the configured latency.

SDRAM and FPGA block RAM use clocked interfaces. Their surrounding logic must match the configured read latency; it cannot treat a clocked memory as an immediate combinational lookup.

Key Takeaways

  • Access time measures data readiness; cycle time limits successive starts.
  • Asynchronous RAM responds to signals without its own clock.
  • Respect write setup, hold, and address stability.
  • Round the number of clock periods up.
  • Synchronous memory returns data at a specified cycle latency.

1.3 Compare SRAM and DRAM storage

SRAM and DRAM both store writable binary data, and both lose it when power is removed. Their difference is how a powered cell keeps its bit. That difference explains refresh, density, and the interface used to reach the data.

Keep a stable state or restore charge

Static RAM (SRAM) uses a bistable storage element that behaves like a latch. It remains in either stable state while powered, without periodic refresh. Dynamic RAM (DRAM) stores a bit as charge on a capacitor. Charge leaks, so the memory must restore it before it becomes too small to distinguish reliably.

FeatureSRAMDRAM
Storage principleBistable stateCapacitor charge
Periodic refreshNot neededRequired
Cell sizeLargerSmaller
Typical trade-offFast, simpler controlDense, low cost per bit
Typical useSmall on-chip memoriesLarge main memory

SRAM's speed and simple control suit register files and buffers inside processors and FPGAs. DRAM's smaller cells put more bits on a chip and reduce cost per bit. The word “static” describes the absence of refresh while powered; it does not mean the data survives a power failure.

Budget refresh time

Refresh reads and restores rows automatically. A controller or internal refresh circuit schedules it; software does not rewrite every word. Refresh preserves the data but temporarily occupies the affected memory resources.

For an example DRAM organized into 8,192 rows with a 64 ms refresh window, an evenly spaced schedule gives

64 ms8,192=7.8125 μs.

That is about 7.8 µs between row refreshes. A 64 ms window is common for DDR3 and DDR4 at normal temperature; the device specification sets the actual requirement. A real refresh command can service a device-defined group of rows, so the example's row count describes this organization.

DRAM reads also disturb the stored charge. The chip restores the row as part of the read operation. From the outside, a completed read leaves the stored word unchanged, just as an SRAM read does.

Send an address in parts

A DRAM can reduce pin count through address multiplexing. The row and column parts of the address arrive at different times on the same physical pins. RAS, the row address strobe, marks the row part; CAS, the column address strobe, marks the column part.

Consider 220 one-bit words arranged as 1,024 rows by 1,024 columns. Selecting a row takes 10 bits and selecting a column takes another 10. The full logical address still contains 20 bits. Sending the two 10-bit parts over the same pins uses only 10 address pins, plus the control interface.

This saving is in package pins, not storage locations or logical address information. Supplying only one 10-bit part would identify a row or a column, not one bit in the complete array.

Key Takeaways

  • SRAM needs power but no refresh; DRAM needs both.
  • DRAM refresh restores charge and occupies memory resources.
  • DRAM restores a disturbed row during a read.
  • Address multiplexing reuses pins for row and column bits.
2

Build memory arrays and combine chips

A decoder turns a binary address into the selection of a storage location. Following that selection from one-bit cells to a large array explains word lines, bit lines, and memory ports. Row and column decoding reduces the selection logic inside a chip. Outside the chip, width and depth expansion use the same selection principles to build a larger memory with a predictable address map.

2.1 Trace a word through cells and a decoder

At the logic level, a binary cell stores one bit. It has select and read/write controls, a data input, and a data output. Connecting many such cells makes a word-addressed memory whose behavior can be traced with gates.

Select one row of cells

When selected for writing, a cell stores its input bit. When selected for reading, it presents its stored bit. When unselected, it keeps its state and outputs zero in this logic model. The zero output is what makes an OR-based read path work.

A 4×4 RAM contains 16 cells: four words, each with four bits. Address bits A1A0 feed a 2-to-4 decoder. Its outputs are word lines. A high word line selects every cell in that word, so all four bits are accessed together.

The data-input line for bit zero connects to the bit-zero cell in all four words. The other three input lines connect in the same way to their columns. On the output side, one OR gate per column combines the four cell outputs. Only the selected cell in that column contributes a stored bit; the others contribute zero.

Trace one write and read

To write 1010 to address 2, apply address 10, data 1010, and write control. Decoder output 2 becomes one. Its four selected cells store the input bits; the other twelve cells retain their values.

For a later read, keep address 10 and select reading. The bit outputs from word 2 enter the four column OR gates. Every unselected word contributes zeros, so the output word is 1010. A one in an unselected word cannot leak into this model's read result.

The memory enable drives the decoder enable. When disabled, all its outputs are zero and no cell is selected. In a packaged chip, output-enable circuitry can also release the external data bus; the internal cell model's zero is not the same as a high-impedance pin.

Connect the model to a real array

Real chips use shared bit lines along columns. Read circuits at their ends recover the selected bits instead of using enormous OR gates. The terms word line, bit line, and memory array apply to both views, but the gate model explains selection without exposing the cell circuitry.

A port is an independent address and data access path. A single-port memory selects one word through its one port. Several ports allow several addressed accesses at once. A register file is a small multiported memory: a 32×32 file with two read ports and one write port can supply two source words and accept a destination word in one cycle. Each read port needs its own address selection.

See the limit of one decoder output per word

This arrangement is linear decoding. For 2k words, a k-to-2k decoder has 2k selection outputs, modeled as AND gates with k inputs each. Ten address wires encode 1,024 possible words; they are not 1,024 individual word wires at the interface. The decoder expands the encoded address internally, which becomes expensive as the memory grows.

Key Takeaways

  • A selected cell reads or writes; an unselected cell retains its bit.
  • A word line selects all bits of one word.
  • Bit lines collect data along columns.
  • Independent ports have independent address paths.
  • Linear decoding needs one selection output per word.

2.2 Locate a word with row and column decoding

A single large decoder is an expensive way to choose among thousands of words. Coincident decoding, or two-dimensional decoding, divides the address between row and column selectors. Their active lines identify a location together.

Split the selection work

A linear decoder for 1,024 words has 1,024 outputs. In the simple gate-count model, it needs 1,024 AND gates with ten inputs each. Arrange the same words as 32 rows by 32 columns instead. Five address bits select one of 32 rows, and five select one of 32 columns.

The row and column decoders each need 32 AND gates with five inputs. Together they use only 64 such gates. This count compares the decoders, not every gate or wire in the complete memory. The array still contains 1,024 word locations and still needs ten address bits.

OrganizationDecoder output gatesInputs per gate
Linear, 1,024 words1,02410
32 rows by 32 columns32 + 32 = 645

The selected location lies where the active row and column meet. Neither selector alone identifies the full address.

Locate address 404

Let the upper five bits select the row and the lower five select the column. Address 404 has the ten-bit form 01100 10100.

  1. Read upper bits 01100 as row 12.
  2. Read lower bits 10100 as column 20.
  3. Rebuild the address: 12×32+20=404.

Division gives the same result: dividing 404 by 32 gives whole-number quotient 12 and remainder 20. For C columns, the row is ⌊A/C⌋ and the column is A mod C. The reconstruction is A=row×C+column.

Use the number of columns as the divisor. That is the number of consecutive addresses in each row. Swapping the address halves would select a different location: row 20, column 12 corresponds to address 652 in this layout.

Compare a larger array

A 4,096-word linear decoder needs 4,096 output gates with 12 inputs. A square array has 64 rows and 64 columns, driven by two 6-to-64 decoders. Their total is 128 output gates with six inputs each. For a square array of N words, decoder output count is about 2N instead of N.

Relate the layout to physical memory

A nearly square array also helps keep word and bit lines short. In a real chip, one activated row commonly contains many bits and several words. Column selection and multiplexers choose which part of that row reaches the data pins. The row-column view therefore describes selection without claiming that every row holds exactly one externally visible word.

DRAM reuses the same logical split when it sends the row and column addresses at different times. Coincident decoding saves internal selection logic; address multiplexing saves external pins. Neither method removes bits from the full logical address.

Key Takeaways

  • Row and column selectors jointly locate a word.
  • A 32-by-32 layout uses two 5-to-32 decoders.
  • Divide by the column count to find the row and remainder.
  • Two-dimensional decoding saves decoder logic, not storage cells or address information.

2.3 Build wider and deeper memories from chips

Chips can cooperate in two different ways. Width expansion adds bits to each word. Depth expansion adds words to the address space. A bank is one chip or a group of chips that jointly supplies one complete word.

Add data width

Four 64K×8 chips can form a 64K×32 memory. All four receive the same 16 address lines and the same bank-select signal. They operate together, each on a separate eight-bit slice: bits 7–0, 15–8, 23–16, or 31–24.

All four chips are enabled at an accessed address, but no two drive the same data bit. The word count and address width stay unchanged. Adding width does not create new addresses.

Add address depth

Four 64K×8 chips can instead form a 256K×8 memory. The low 16 address bits reach every chip. Two extra upper bits feed a 2-to-4 decoder that enables exactly one chip at a time. The full memory needs 18 address lines.

Upper bitsSelected chipAddress range
0000x00000–0x0FFFF
0110x10000–0x1FFFF
1020x20000–0x2FFFF
1130x30000–0x3FFFF

For address 0x2A3F1, upper bits 10 select chip 2 and low bits 0xA3F1 select the word inside it. The eight data lines are shared between chips. Unselected chips must use three-state outputs and go to high impedance. Enabling two chips onto the same bus bits causes bus contention, which can produce invalid levels and damage outputs.

Expand both dimensions

To build 128K×16 from 32K×8 chips, calculate each dimension:

128K32K=4 banks,168=2 chips per bank.

The total is eight chips. Fifteen low address bits reach each chip, while two upper bits select one of four banks. The two chips inside the selected bank operate together on different byte slices. The full memory has 17 address lines.

Check for aliasing and overlaps

Leaving an address bit out of selection creates aliasing: more than one address reaches the same stored word. For two 64K×8 chips on an 18-bit address bus, using only bit 16 to select a chip and ignoring bit 17 makes chip 0 answer in both 0x00000–0x0FFFF and 0x20000–0x2FFFF. Toggling the ignored bit changes no physical selection.

Full decoding assigns every relevant upper bit a role in selecting or excluding a bank. A mixed 16-bit address space can put a 32K×8 ROM at 0x0000–0x7FFF when bit 15 is zero, and an equally deep RAM at 0x8000–0xFFFF when it is one.

Check each bank's first and last address, which chips operate together, and which data bits each chip drives. A complete contiguous memory has one selected bank for each valid address, with no gaps or overlapping bank ranges.

Key Takeaways

  • Width expansion connects chips to different data-bit slices.
  • Depth expansion decodes upper address bits to select a bank.
  • Chip count is the product of the depth and width expansion factors.
  • Only one bank may drive each shared data bit.
  • Ignored address bits cause aliases.
  • Address ranges include both endpoints.
3

Detect errors and recover a stored word

Extra check bits make a stored word carry information about its own consistency. A parity bit can flag some errors; overlapping Hamming checks can locate one flipped bit. You will build those checks from numbered positions, decode their results, and use overall parity to distinguish a correctable single error from a detected double error. The bit order stays fixed from encoding through correction.

3.1 Generate parity and understand its limits

A bit can flip because of noise, radiation, or a failing storage cell. A soft error disappears when the word is rewritten; a hard error comes from a permanent fault. Extra check bits let a memory system notice an inconsistent word and, with a suitable code, recover the data.

Set a parity bit

Even parity makes the total number of ones in the data and parity bit even. Odd parity makes that total odd. Count the complete stored word when checking, including the parity bit itself.

The data 1011001 contains four ones. Its even-parity bit is zero, giving 10110010 when parity is appended at the right. Its odd-parity bit is one, giving 10110011. The bit is not always zero for even parity: data with an odd count needs a one to make the combined count even.

An XOR of all data bits computes the even-parity bit. XOR is one when an odd number of inputs are one. Appending that result turns an odd data count into an even total and leaves an even count even. For odd parity, invert that generated bit.

Check the whole stored word

On reading an even-parity word, XOR all its bits, including parity. A result of zero means no error was detected; one means the check failed. For odd parity, a valid word gives one instead.

A tree combining n bits needs n−1 two-input XOR gates. For example, four inputs need three gates: combine the first pair, combine the second pair, then XOR the two intermediate results. The generator and checker must use the same convention.

Trace one error and two errors

Start with the even-parity stored word 10110010.

  • Reading 10010010 means one bit changed. There are three ones, so the odd total fails the even-parity check.
  • Reading 10000010 means two bits changed. There are two ones, so the even total passes even though the data is wrong.

Each flip toggles the parity of the word. An odd number of flips changes it; an even number changes it back. One parity bit therefore detects every odd number of flipped bits and misses every even number.

A passed check means only that the word has the expected parity. It is not a guarantee of unchanged data. This matters when interpreting a memory status flag: “no error detected” and “known to be correct” are different claims.

Why detection is not correction

A failed parity check does not identify a position. Any one of the stored bits could be the one that changed, including the parity bit. The system can report the failure, signal a processor, or stop the computation, but a single parity check cannot choose a bit to repair.

Hamming coding adds several parity relationships over different, overlapping groups. Each position belongs to a unique combination of groups. A single error then leaves a recognizable pattern of failures, turning a general alarm into a location.

Key Takeaways

  • Even and odd parity count the data and parity bit together.
  • XOR of the data generates the even-parity bit.
  • One parity bit detects odd numbers of flips and misses even numbers.
  • A parity failure gives no error location.

3.2 Place and calculate Hamming check bits

A Hamming code assigns each stored position a unique pattern of parity-group memberships. The check results must distinguish every possible single-bit error from the case where no bit changed. That requirement determines how many check bits to add.

Find the check-bit count

For n data bits and k check bits, choose the smallest k satisfying

2k≥n+k+1.

There are n+k positions to identify and one additional no-error case. For eight data bits, three checks give only eight patterns for twelve cases, so they are too few. Four give sixteen patterns for thirteen cases and are enough. The stored word has twelve bits.

Data bitsHamming checksStored bits
123
2–435–7
5–1149–15
12–26517–31
27–57633–63
58–120765–127

For common data widths, 16 bits need five checks, 32 need six, and 64 need seven. These are Hamming checks alone, before adding an overall parity bit. Check-bit overhead becomes a smaller fraction of the stored word as the data width grows.

Reserve power-of-two positions

Number positions from one, left to right. Put checks at 1, 2, 4, 8, and so on. Fill the remaining positions with data in its original order, with the leftmost data bit first. An eight-bit input occupies this layout:

P1 P2 D1 P4 D2 D3 D4 P8 D5 D6 D7 D8.

Do not start numbering at zero or place the input as one uninterrupted block followed by all the checks.

Build overlapping groups

A check at position 2i covers positions whose binary index has bit i set. Position 6 is binary 0110, so it belongs to the checks at 2 and 4. For twelve stored positions:

  • Check 1 covers 1, 3, 5, 7, 9, 11.
  • Check 2 covers 2, 3, 6, 7, 10, 11.
  • Check 4 covers 4, 5, 6, 7, 12.
  • Check 8 covers 8, 9, 10, 11, 12.

Generate each check bit by XORing only the data positions in its group. This makes the complete group even. Include the check bit when later checking the group, not when calculating its initial value.

Encode 10011010

Place the data in positions 3, 5, 6, 7, 9, 10, 11, 12 as 1, 0, 0, 1, 1, 0, 1, 0.

For check 1, the data values at 3, 5, 7, 9, 11 are 1, 0, 1, 1, 1: four ones, so P1=0. Check 2 sees 1, 0, 1, 0, 1: three ones, so P2=1. Check 4 sees 0, 0, 1, 0, giving P4=1. Check 8 sees 1, 0, 1, 0, giving P8=0.

In positions 1 through 12, the result is 011100101010. Memory stores all twelve bits. XOR logic generates the checks on each write, adding storage and circuitry without requiring software to calculate them.

Key Takeaways

  • Choose the smallest check count with enough syndromes for all positions plus no error.
  • Check bits occupy positions 1, 2, 4, 8, and so on.
  • Data fills the other positions in order.
  • Binary position numbers determine group membership.
  • Generate a check from data bits; verify it with the check bit included.
  • Eight data bits need four Hamming checks.

3.3 Read the syndrome and decide whether to correct

Rechecking a Hamming word produces one bit per parity group. Write these bits with their position weights in descending order. The resulting syndrome identifies a single erroneous stored position, including a check-bit position.

Calculate a syndrome

For the twelve-bit layout, compute C1,C2,C4,C8 by XORing each entire group, now including its stored check bit. Write the result as C8C4C2C1. Zero means all groups passed. For one flipped bit, the syndrome's binary value is its position; invert that bit to restore the code word.

Suppose 011100101010 is read as 011101101010. Group 1 still has four ones, so C1=0. Group 2 has five, giving C2=1. Group 4 has three, giving C4=1. Group 8 has two, giving C8=0. Thus the syndrome is 0110, or 6. Flip position 6 to recover 011100101010, then extract data from positions 3, 5, 6, 7, 9, 10, 11, 12 to recover 10011010.

A syndrome of 0100 points to check bit 4. Correction can repair a check bit even when the data itself was unchanged. Reversing the result order is a real hazard: 0011 names position 3, while 1100 names position 12.

See why plain correction can fail

For two flipped positions, the syndrome is the XOR of their position numbers. Errors at 3 and 10 give

0011⊕1010=1001,

or 9. Flipping position 9 would add a third wrong bit. A nonzero syndrome alone cannot distinguish a single error from a double error. In a shortened code, a multi-error syndrome can also name a position outside the stored word.

Add overall parity for SEC-DED

SEC-DED means single-error correction and double-error detection. Add one extra bit that makes the entire Hamming word even. For the twelve-bit example, append P13. The word 011100101010 has six ones, so the extra bit is zero: 0111001010100.

On reading, let P be the XOR of all thirteen stored bits. Use it together with the Hamming syndrome C:

SyndromeOverall checkDecision for up to two flips
Zero0No error detected
Nonzero1Correct position named by syndrome
Nonzero0Report double error; do not correct
Zero1Correct the extra overall parity bit

Two errors leave overall parity even but make the Hamming syndrome nonzero. The extra test therefore prevents the misleading correction in the 3-and-10 example. A fault in the overall parity bit makes overall parity odd without disturbing any Hamming group.

For 64 data bits, seven Hamming checks plus one overall parity bit give 72 stored bits, often written (72,64). SEC-DED guarantees correction of every single-bit error and detection of every double-bit error. With three or more flips, the observed checks can imitate a different case and cause a missed error or a wrong correction.

Key Takeaways

  • Write syndrome bits in descending weight order.
  • A single-error syndrome identifies the bit to invert.
  • Two errors can imitate a different single-error position.
  • Overall parity distinguishes single from double errors within SEC-DED capability.
  • A 64-bit data word uses eight added bits in a (72,64) SEC-DED code.
4

Use ROM as stored data and combinational logic

A ROM can be read as a table of stored words or as a circuit that maps inputs to outputs. Its decoder makes that connection explicit: an address chooses one row of the table. You will compare programming and erase methods, build a ROM from a truth table, and reduce storage when an output is already a constant or a direct input connection. Input count sets the cost of the table.

4.1 Explain ROM connections and programming methods

A read-only memory (ROM) stores information that is fixed at manufacture or entered through a programming operation. Ordinary use then reads that information. ROM is nonvolatile: its stored contents survive when power is removed.

Follow the decoder and OR connections

A 2k×n ROM has k address inputs and n data outputs. A k-to-2k decoder activates one line for each possible address. Each line represents one minterm of the input variables.

Each output has an OR gate with possible connections to those decoder lines. A connection from a selected line makes that output bit one; no connection makes it zero. The programming pattern therefore specifies which address rows produce a one at each output.

A 32×8 ROM needs five address inputs and a 5-to-32 decoder. Eight output OR gates each have 32 possible decoder connections. There are 32×8=256 crosspoints, matching the 256 stored bits. Adding another output would add 32 more stored bits; adding another address input would double the rows.

The ROM truth table lists every address and its output word. It completely specifies the information to program. To change one output bit at one address in this model, change the corresponding connection.

Compare nonvolatile technologies
TypeHow contents are set or erasedMain distinction
Mask ROMSet during chip manufactureFixed contents; economical in large volumes
PROMUser programs once, classically by blowing fusesNo erase operation
EPROMUltraviolet light erases through a package windowErase, then reprogram
EEPROMElectrical erase and rewrite, typically byte by byteSmall updates without UV erasure
FlashElectrical erase in blocksHigh-density storage

“Read-only” describes normal access, not an inability to change every device ever sold as ROM. Mask ROM and one-time PROM are fixed after programming. EPROM, EEPROM, and flash can be rewritten through their programming procedures. Their writes are much slower than reads, and cells have limited erase/write endurance, which suits read-mostly uses.

Flash stores firmware and FPGA configurations, as well as data in USB drives and solid-state drives. The block erase requirement matters when updating a small value: erasing is organized in larger units than an individual bit.

Treat an ordinary ROM read as a lookup

At the combinational level, the current address determines the output word while the chip is enabled. The selected outputs become valid after the access delay. This is useful for fixed code, character patterns, sine tables, and code converters.

A table address is not an instruction to modify the ROM. Reading simply selects the word already programmed there. The kind of ROM determines how its stored table can be changed; the decoder-and-output model determines which row is read.

Key Takeaways

  • A ROM is nonvolatile.
  • A decoder selects an address row; programmed OR connections form its word.
  • The complete truth table specifies ROM contents.
  • PROM is one-time; EPROM uses UV erase; EEPROM and flash use electrical erase.
  • Flash erases blocks.

4.2 Turn a truth table into ROM contents

A ROM can implement a combinational circuit by storing its truth table. The input bits are the address; the output bits are the selected data word. A minimal Boolean expression is not required because the decoder already forms every input minterm.

Choose the dimensions

For k inputs and m stored outputs, use a 2k×m ROM. Enumerate the input patterns in the chosen address order, calculate each output word, and program it at that address. Treat bit order as part of the design: changing which input is most significant changes the table layout.

Build a four-bit squaring table

Let inputs A3A2A1A0 represent integers from zero through fifteen. The circuit outputs their square. Since 152=225, and 225 needs eight binary bits, a direct implementation is a 16×8 ROM.

Address inputInput valueStored outputSquare
011060010010036
11011310101001169
11111511100001225

For address 1101, write 10101001 into row 13. Applying that address then selects 169 after the ROM's access delay.

Remove outputs that need no table

The least significant square bit satisfies B0=A0: odd inputs have odd squares, and even inputs have even squares. Wire that output directly. The next bit, B1, is always zero because every square has remainder zero or one on division by four. Tie it to zero.

Only B7 through B2 need storage, reducing the ROM to 16×6=96 bits instead of 128. For input 13, the six stored high bits are 101010. Appending fixed bit zero and direct input bit one gives 10101001. Removing an output column saves bits per row; it does not remove address rows.

Define unused input codes

A BCD-to-excess-3 converter adds three to a valid decimal digit represented in four-bit BCD. A direct design uses a 16×4 ROM. Input 0101 stores 1000; input 1001 stores 1100.

BCD uses only addresses zero through nine. The other six input codes never occur in the intended operation, so their output values can be chosen freely. Still enter a concrete programming word for each, such as 0000. A don't-care in the function specification is freedom to choose a value, not a physical empty word.

Judge the size cost

Each additional input doubles the number of rows. Sixteen inputs require 65,536 rows per stored output bit even when the function has a short SOP expression. ROMs therefore suit few-input, many-output functions and tables with little simple Boolean structure.

In array terms, a ROM has a fixed AND array that generates every minterm and a programmable OR array. A PLA can select just the product terms it needs, while an FPGA LUT uses the same stored-truth-table principle on a small scale.

Key Takeaways

  • Connect circuit inputs to address lines and outputs to data lines.
  • A direct table for k inputs and m outputs needs 2ᵏ × m bits.
  • Constants and direct input outputs need no ROM column.
  • Program definite values for unused input codes.
  • Every additional address input doubles the table size.
5

Fit logic into programmable arrays

Programmable arrays turn sum-of-products equations into connected hardware. A PLA can share product terms across outputs; a PAL assigns a fixed group to each output. You will map equations into programming tables, account for output inversion, and handle a function that exceeds one group’s capacity. Adding flip-flops introduces state, while CPLDs connect many small programmable blocks into a larger device.

5.1 Write a PLA programming table

A programmable logic array (PLA) implements sum-of-products logic with two programmable stages. Its AND array forms selected product terms from true or complemented inputs. Its OR array connects those terms to outputs, allowing several outputs to share one term.

Read the array notation

Each input supplies both its true and complemented forms. An × at a crossing marks a programmed connection; it does not mean inversion. A single drawn line into a gate represents the gate's multiple inputs. Early programmable devices used fuses at crosspoints; other technologies use antifuses or nonvolatile cells.

A PLA with n inputs, k product terms, and m outputs is described as n×k×m. There are 2nk possible AND-array connections and km OR-array connections. Many PLAs also offer programmable output inversion: true polarity, T, or complemented polarity, C.

List distinct terms before assigning outputs

Consider

F1=AB′+AC+A′BC′,F2=AC+BC.

The first function is one at minterms 2, 4, 5, and 7; the second at 3, 5, and 7, with A the most significant input. The distinct products are AB′, AC, A′BC′, and BC. The term AC is formed once and connected to both outputs.

A programming table uses 1 for the true input, 0 for its complement, and – when that input is absent from the product:

TermABCF1F2
AB'10–10
AC1–111
A'BC'01010
BC–1101

Both outputs use true polarity. A dash removes an input from that AND term; it does not force the input to zero. For the AC row, either value of B is allowed.

Count the physical resources

Four distinct terms require a 3×4×2 PLA. Its AND array has 2×3×4=24 crosspoints and its OR array has 4×2=8. Counting AC twice would describe a larger implementation than necessary. Counting literals alone would miss the actual limit on the number of available product rows.

Check whether a complement saves terms

First minimize each function, then inspect sharing between outputs. Also consider a function's complement if the device permits output inversion. Program the complement and select C polarity to recover the desired output.

For the example, F1′=A′B′+A′C+ABC′ also needs three terms and shares none with the displayed F2 terms. It offers no saving, so retain the true form. A shorter expression for one output is useful only if the combined set fits the device better.

A ROM generates every minterm with a fixed decoder and programs the OR connections. A PLA programs both arrays and can use only needed products. That extra flexibility costs more programmable structure and typically more delay than a comparable PAL with only one programmable array.

Key Takeaways

  • Both PLA arrays are programmable.
  • The same product term can feed several outputs.
  • A dash means an input is absent from a product term.
  • Count distinct products after considering sharing.
  • Output inversion can make a complemented function useful.

5.2 Respect PAL term limits and output polarity

A programmable array logic (PAL) device has a programmable AND array and a fixed OR array. Each output receives its own assigned group of product terms. That fixed grouping makes the device simpler than a PLA but restricts how equations fit.

Count terms per output

A product needed by two PAL outputs must be formed twice, once in each output's group. The functions F1=AB′+AC+A′BC′ and F2=AC+BC need four distinct products in a PLA but five term instances in a PAL: three for F1 and two for F2.

Each function must fit the fixed product group assigned to its output pin. Check the device's term allocation and polarity before programming.

The PAL16L8 illustrates this structure. It has ten dedicated inputs and six feedback-capable I/O pins, allowing up to sixteen signals into the AND array. Eight combinational outputs each have seven logic product terms plus a separate output-enable term. The “L” identifies active-low outputs: the pin carries the complement of the internal OR sum.

Account for the inversion

If the required pin function is F, the internal sum must implement F′ on a fixed inverting output. For a pin function F=A+B, the programmed internal term is A′B′, since F=(A′B′)′. Loading A and B as the internal sum would instead produce the complemented pin function.

Apply the same polarity rule to feedback: write equations for actual pin signals before mapping each through the output inverter.

Split a function that needs too many terms

Four-input odd parity is

F=A⊕B⊕C⊕D.

Its eight one-valued minterms are 1, 2, 4, 7, 8, 11, 13, and 14. No pair is adjacent on a Karnaugh map, so its minimal two-level SOP has eight terms. It will not fit a seven-term output group directly.

Define actual pin functions X=A⊕B and Y=C⊕D, then feed those pins back and produce F=X⊕Y on a third output. For active-low pins, program the complements:

  • Internal sum for X: AB+A′B′.
  • Internal sum for Y: CD+C′D′.
  • Internal sum for F: XY+X′Y′.

Each sum has two terms, and the output inversion makes the required XOR pin function. The result uses three outputs and six logic product terms. The output-enable terms are separate from this count.

Include the feedback cost

Feedback uses output resources for partial results and introduces another pass through the array. The path from A or B to F now goes through the first XOR output and the final XOR output. Rewriting a function to fit one group can avoid that delay; when it cannot fit, feedback provides a useful multi-level implementation.

Key Takeaways

  • A PAL has a programmable AND array and fixed OR groups.
  • Shared logical products must be duplicated across PAL outputs.
  • Check the term limit separately for each output.
  • An active-low pin requires the internal complement of its desired function.
  • Feedback can overcome a term limit at the cost of outputs and delay.
  • PAL16L8 logic terms and output-enable terms have separate roles.

5.3 Store state in macrocells and choose a device

Combinational arrays respond to current inputs. A sequential programmable device adds flip-flops so its outputs can also depend on stored state. A macrocell combines one output's SOP logic, a D flip-flop, and multiplexers for output mode, polarity, and feedback.

Choose registered or combinational output

A macrocell can send the direct logic result to its output or register that result on a clock edge. Feedback brings either the configured output or state signal back into the array. One configured output does not provide two independent pin signals just because both paths exist internally.

The PAL16R8 has eight registered outputs sharing one clock. Their flip-flops sample their D values on the same edge. The new state is calculated from the old state; one flip-flop does not first update and then clock the next one.

The reprogrammable GAL22V10 has ten output logic macrocells with true or inverted and registered or combinational modes. Its logic-term allocations are 8, 10, 12, 14, 16, 16, 14, 12, 10, and 8. Each also has a separate output-enable term. Pin assignment therefore affects which functions fit.

Implement an enabled two-bit counter

Let Q1Q0 hold the state, and let enable E control whether the counter advances. The low bit toggles when E is one:

D0=Q0⊕E=Q0E′+Q0′E.

The high bit toggles only when E and the old low bit are both one:

D1=Q1⊕Q0E=Q1Q0′+Q1E′+Q1′Q0E.

The equations use two and three SOP terms. From state 01 with E equal to one, they give D1D0 equal to 10. Both flip-flops capture together, advancing the count. With E zero, the equations reduce to D0 equal to Q0 and D1 equal to Q1, so the state holds. At 11 with E one, the next state is 00.

Connect blocks into a CPLD

A complex programmable logic device (CPLD) joins several PAL-like blocks through programmable global interconnect. Each block holds many macrocells. Typical CPLDs keep their configuration in nonvolatile cells, so no external configuration reload is needed at power-up. Their regular array paths make timing relatively easy to predict.

Programming technology is a separate choice. Fuses and antifuses are one-time; EPROM is UV-erasable; EEPROM and flash are electrically erasable and nonvolatile. SRAM configuration is volatile and can be rewritten without an erase-cycle endurance limit. In-system programming, often through JTAG, configures a device while it is mounted on its board.

Match the device to the circuit
DeviceA useful match
ROMA complete table with few inputs
PLASeveral outputs sharing SOP terms
PAL or GALSmall glue logic or a simple state machine
CPLDMedium logic needing nonvolatile startup and predictable timing
FPGALarger designs with substantial memory or arithmetic

Device names identify architectures, not a universal promise of reprogrammability. Check both the available logic structure and the technology that stores its configuration.

Key Takeaways

  • A macrocell adds selectable registered output and feedback to SOP logic.
  • Shared-clock flip-flops capture their next states together.
  • GAL22V10 output groups have different term capacities.
  • A CPLD connects many PAL-like blocks.
  • Programming technology determines retention and whether a device can be changed.
  • Choose hardware from the function, state, capacity, and startup needs.
6

Build hardware with FPGA resources

An FPGA stores a circuit configuration that selects logic functions, state elements, and connections across the chip. A lookup table implements one Boolean function as a tiny memory. You will fill its truth table, split functions that exceed one table’s input width, and connect logic blocks through routing. Dedicated memory, arithmetic, I/O, and clock resources extend the design beyond individual LUTs.

6.1 Program LUT contents and connect logic blocks

A field-programmable gate array (FPGA) contains configurable logic blocks connected by programmable routing and surrounded by I/O blocks. Configuration after manufacture chooses the circuit. The resulting blocks operate as hardware, including many activities in parallel.

Read a LUT as a tiny ROM

A lookup table (LUT) with k inputs is a 2k×1 memory. Its input pattern selects an address, and the stored bit is the output. Any Boolean function of those inputs fits by storing its truth table. There are 22k possible contents and therefore that many functions.

A four-input LUT holds sixteen bits and can implement 65,536 functions. A six-input LUT holds 64 bits. A function may use fewer inputs than the LUT offers; unused input combinations simply repeat the required values.

Fill a majority-function LUT

Let M be one when at least two of A, B, and C are one, with A the most significant address bit. Addresses zero through seven store 0, 0, 0, 1, 0, 1, 1, 1. At address 101, A and C are one, so the stored output is one.

When contents are written with the highest address on the left, those bits become 11101000, or 0xE8. Address order and printed bit-string order are opposite views of the same table; state which one is being used before converting to hexadecimal.

For F=AB+CD in a four-input LUT with A most significant, ones occur at addresses 3, 7, 11, 12, 13, 14, and 15. Highest-address-first contents are 1111100010001000, or 0xF888.

Count LUTs from inputs, not gates

Propagation through a LUT does not depend on which truth table it holds. A complicated function that fits one LUT does not need extra internal logic levels. Six-input XOR uses five two-input XOR gates in a gate implementation but fits one six-input LUT.

A function with more inputs may need decomposition. Shannon expansion separates the cases for one input x:

f=x′fx=0+xfx=1.

For a seven-input function, two six-input LUTs compute the cases with x fixed at zero and one. A 2-to-1 multiplexer selected by x chooses the result. That selector can use a third LUT or a dedicated multiplexer. The decomposition creates a path through a case LUT and a selection stage.

Add state and arithmetic nearby

Logic blocks add D flip-flops that can register LUT outputs, multiplexers that choose direct or registered results, and fast carry chains for addition and counting. Registers and their next-state logic can therefore sit close together.

For an AMD 7-series example, a slice has four six-input LUTs, eight storage elements, and a carry chain; a CLB contains two slices. Each LUT can also implement two five-input functions sharing the same five inputs. Some slices support distributed RAM or shift-register use of their LUT storage. Other FPGA families organize and name their blocks differently.

The LUT's truth-table contents reside in configuration memory. Loading a new configuration can turn the same physical LUT from one function into another.

Key Takeaways

  • A k-input LUT stores 2ᵏ output bits.
  • Truth-table inputs are LUT addresses.
  • State the address-to-bit-string order when writing LUT contents.
  • A function’s gate count does not determine its LUT count.
  • Shannon expansion splits a larger function into selected cases.
  • Logic blocks add flip-flops, selection, and carry resources.

6.2 Use routing, embedded blocks, and configuration

LUTs provide logic, but a complete FPGA design also needs connections, pins, memory, arithmetic, and clocks. These resources are configured together. Their placement and routing affect whether signals arrive at the times required by the design.

Connect blocks and pins

Programmable routing uses wire segments joined by controlled switches. Configuration bits choose which switches connect which segments. Routes consume area and can contribute a large share of a signal path's delay. Moving two related logic blocks closer can shorten a route even if their Boolean equations stay unchanged.

I/O blocks connect the fabric to package pins. They support input, output, or bidirectional use, three-state control, suitable electrical standards and voltages, and optional pin registers. A correct internal function still needs a compatible pin configuration.

Use dedicated resources

Block RAM is dedicated synchronous SRAM, often with two ports. In AMD 7-series, a 36 Kb block can be divided into two 18 Kb memories. Here 18 Kb means 18×1,024=18,432 bits, including the available parity-bit capacity. A 1,024×16 memory needs 16,384 bits and fits a 1,024×18 organization. A small 64×1 memory can fit one six-input LUT configured as distributed RAM.

DSP blocks provide multipliers and adders for multiply-accumulate operations. A 7-series DSP48E1 includes a 25-by-18-bit multiplier. Clock resources provide low-skew distribution and clock managers such as PLLs that produce required frequencies and phases. These blocks avoid implementing common large operations solely with general LUTs.

Keep or reload configuration
TechnologyAfter power is removedProgramming behavior
SRAM configurationLostLoad a bitstream at startup; reconfigure later
Flash configurationRetainedNo external configuration reload at startup
Antifuse configurationRetainedProgram once

SRAM-based FPGAs load a bitstream from external flash, a processor, or a programming interface such as JTAG. Flash configuration and user block RAM are different storage roles: nonvolatile configuration does not turn every data memory into nonvolatile storage.

Follow the hardware design flow
  1. Describe a circuit in an HDL or schematic.
  2. Synthesis turns the description into logic.
  3. Technology mapping chooses LUTs, flip-flops, and dedicated resources.
  4. Placement assigns physical locations.
  5. Routing connects the placed resources.
  6. Timing analysis checks setup, hold, and I/O requirements.
  7. Generate and load the bitstream.

Reports show resource use and achievable clock timing. Setup checks concern signals arriving in time; hold checks also constrain signals that could arrive too soon. A low LUT count alone does not establish a fast design.

An FPGA configures circuits, not a processor's sequential instruction stream, although a processor can be built in its logic. It avoids fabricating a new chip for each design. An ASIC can offer better speed, power, and per-unit cost at very large volume, at the expense of substantial design and fabrication effort. A CPLD serves smaller designs with a simpler nonvolatile startup and timing model.

Key Takeaways

  • Routing delay depends on placement and selected paths.
  • Block RAM, DSP, and clock resources provide dedicated hardware.
  • SRAM-based FPGA configuration must reload after power-up.
  • Synthesis, mapping, placement, and routing have different jobs.
  • Timing analysis checks setup, hold, and interfaces.
  • FPGA configuration defines parallel hardware circuits.

Memory and Programmable Logic examples

6 Walkthroughs

1

Read, write, and time a memory

14 steps
Work from memory dimensions through clock timing, then compare SRAM storage with refreshed DRAM charge.
  1. 1
    IntroductionFollow one memory operation

    A memory operation has a destination, a data word, and a time window. An address selects where the operation happens, data lines carry the bits, and controls choose read or write. Start by separating those roles; then follow the same interface over time to see why a correctly selected word can still be captured too early. That wait is set by access time and cycle time, and DRAM adds refresh to keep its stored charge.

  2. 2
    ExplanationSeparate location from contents

    A 64K×16 RAM contains 65,536 separately addressed words, each sixteen bits wide. Address zero and address one are different locations even if they contain the same value. Sixteen address lines select among the words; sixteen data lines carry the selected word. The matching counts here are a coincidence of the chosen organization.

  3. 3
    ExampleConvert stored bits into bytes

    Multiply the word count by its width: 65,536×16=1,048,576 stored bits. Divide by eight to obtain 131,072 bytes, then by 1,024 to get 128 KiB.

    K in the word count means 1,024. KiB makes the binary byte unit explicit; kB would mean 1,000 bytes.

  4. 4
    ChallengeChange the word width

    The same 65,536 word addresses now store 32 bits each. How many address lines and data lines are required?

    ---reveal---

    The memory still needs sixteen address lines because its word count is unchanged. It needs 32 data lines to carry the wider word. Its capacity doubles, but there are no new locations for the address to distinguish.

  5. 5
    ExplanationRead a word or replace it

    Writing applies an address and incoming data, then activates write with the required timing. Reading selects an address and returns a copy of the stored word. Chip select enables the device; an active-low select is asserted at zero. When an inactive chip releases its output pins into high impedance, it lets a different chip use the shared data bus.

  6. 6
    ExplanationUse two timing limits

    Access time tells you when a selected read word becomes valid. Cycle time tells you when another operation may start. A RAM with 25 ns access and 35 ns cycle time can supply data before it is ready for a second operation. Keep the data-capture event and the next-start event separate when drawing a timing sequence.

  7. 7
    ExampleSchedule a read on clock edges

    A 100 MHz controller has a 10 ns clock period. A read begins at time zero. With 25 ns access time, capture at the 30 ns edge allows the data to become valid first.

    A 35 ns cycle time still prevents another operation from starting at 30 ns. Its earliest permitted clock edge is 40 ns, four periods after the first start.

  8. 8
    ChallengeFind the earliest allowed edge

    Using that 10 ns clock, a different RAM needs 42 ns between operation starts. At what edge can the next operation begin?

    ---reveal---

    At 50 ns, after five periods. Four periods provide only 40 ns, which is too short. The controller must round the required interval up to a whole number of periods; it cannot use a rounded-down average.

  9. 9
    TipProtect a write window

    During an asynchronous write, keep the address fixed through its specified interval. Data must be stable for setup before the write-ending event and hold afterward. Synchronous RAM instead samples inputs at clock edges and returns reads at a specified latency. A shared system clock does not remove the need to check the memory’s own timing requirements.

  10. 10
    AnalogyKeep a state or restore charge

    Think of SRAM as a latch that keeps either stable state while power remains on. DRAM instead keeps a bit as capacitor charge, which slowly leaks. Refresh restores that charge before information is lost. Both need power: “static” means no refresh is needed, while “nonvolatile” means contents survive power removal.

  11. 11
    ExampleSpace DRAM refreshes

    An example DRAM has 8,192 rows to refresh in 64 ms. An evenly spread one-row schedule allows 64 ms/8,192=7.8125 μs between refreshes.

    The controller or refresh circuitry performs this work. Refresh preserves data but occupies the affected resources. Reading a DRAM row also restores the charge disturbed by the read.

  12. 12
    ChallengeDistinguish bits from pins

    A 1,024×1,024 one-bit DRAM array sends its row and column addresses on shared pins. How many logical address bits and physical address pins does it use for the two parts?

    ---reveal---

    It needs twenty logical address bits: ten for the row and ten for the column. The two parts reuse ten pins, marked by row and column strobes. Pin sharing saves connections without reducing the information needed to locate a bit.

  13. 13
    ConnectionChoose storage for a buffer

    A small fast buffer can use SRAM to avoid refresh and simplify control. A large main memory commonly uses DRAM for its smaller cells and lower cost per bit. In either case, a successful read must return the selected word at the interface’s promised time. The choice of cell technology changes how the chip preserves data behind that interface.

  14. 14
    RecapCheck dimensions and deadlines

    When reading a memory specification, identify its word count, word width, active control levels, access delay, and cycle interval. For DRAM, also account for refresh and the row/column address interface. These quantities answer different design questions; use the one that controls the event you are scheduling.

2

Trace selection from cells to chip banks

14 steps
Select one word inside an array, locate it by row and column, then build an address map from multiple chips.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionFollow the selection path
  2. 2
    ExplanationMake a word from one-bit cells
  3. 3
    ExampleSee why the read OR gates work
  4. 4
    ChallengeDisable the array
  5. 5
    ConnectionGive reads independent addresses
  6. 6
    ExplanationSplit the decoder
  7. 7
    ExampleSplit address 404
  8. 8
    ChallengeMove to another row
  9. 9
    ExplanationAdd bits side by side
  10. 10
    ExampleAdd addresses with banks
  11. 11
    TipRelease shared data lines
  12. 12
    ChallengeCombine width and depth
  13. 13
    ChallengeDiagnose a repeated address range
  14. 14
    RecapTrace one address end to end
3

Encode, damage, and recover a word

17 steps
Build a Hamming word one group at a time, recover a single error, and use overall parity to reject a double error.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionMake errors leave a pattern
  2. 2
    ExplanationSet the parity convention
  3. 3
    ChallengePredict a missed error
  4. 4
    ExampleChoose enough Hamming checks
  5. 5
    ExplanationPlace the input bits
  6. 6
    Key InsightUse the binary position as a group label
  7. 7
    ExampleCalculate checks 1 and 2
  8. 8
    ExampleComplete checks 4 and 8
  9. 9
    ChallengeIdentify one data bit’s checks
  10. 10
    ExplanationRecheck with the stored checks included
  11. 11
    ExampleRecover an error at position 6
  12. 12
    ChallengeCorrect a check-bit fault
  13. 13
    ExampleSee a misleading double-error syndrome
  14. 14
    ExplanationAdd the overall parity check
  15. 15
    ChallengeCombine the two check results
  16. 16
    ConnectionScale to a 64-bit data word
  17. 17
    RecapKeep the correction decision in order
4

Build a ROM-based function

10 steps
Read a ROM’s connection model, choose a programming technology, and reduce a squaring table with direct outputs.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionStore the output for every input
  2. 2
    ExplanationFollow one programmed connection
  3. 3
    ConnectionMatch the erase method
  4. 4
    ChallengeChoose between EEPROM and flash
  5. 5
    ExampleSize the squaring function
  6. 6
    Key InsightWire the two simplest outputs
  7. 7
    ExampleReassemble a reduced output
  8. 8
    ChallengeProgram an unused code
  9. 9
    ChallengePredict the cost of another input
  10. 10
    RecapCheck rows, columns, and direct wires
5

Map equations into PLAs, PALs, and macrocells

15 steps
Share products in a PLA, fit fixed PAL groups, and register next-state logic for a counter.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionTurn equations into connections
  2. 2
    ExplanationShare one product across outputs
  3. 3
    ExampleWrite the shared product’s row
  4. 4
    ChallengeCount connections in the chosen PLA
  5. 5
    ConnectionFreeze the OR groups
  6. 6
    ExplanationInclude the output inverter
  7. 7
    ExampleFind a term-limit problem
  8. 8
    ExampleMap the feedback equations to active-low pins
  9. 9
    ChallengeExplain what spare terms cannot do
  10. 10
    ExplanationAdd a flip-flop to the output
  11. 11
    ExampleCalculate the low counter bit
  12. 12
    ExampleCalculate the high counter bit
  13. 13
    ConnectionConnect many macrocells
  14. 14
    ChallengeFit the next-state logic
  15. 15
    RecapCheck the architecture before counting
6

Map a truth table into FPGA hardware

13 steps
Fill a LUT, split a larger function, then connect dedicated memory and arithmetic resources into a configured design.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionConfigure circuits across a chip
  2. 2
    ExplanationAddress a LUT with its inputs
  3. 3
    ExampleFill a majority truth table
  4. 4
    ExampleWrite the contents as hexadecimal
  5. 5
    ChallengeLook up one input pattern
  6. 6
    Key InsightCount input dependence, not drawn gates
  7. 7
    ExplanationSplit a seven-input function
  8. 8
    ConnectionPlace logic and route the wires
  9. 9
    ExampleChoose a memory resource
  10. 10
    ExplanationUse arithmetic and clock blocks
  11. 11
    ChallengePredict a power-cycle failure
  12. 12
    ChallengeInterpret an implementation report
  13. 13
    RecapConnect function, resources, and timing

Memory and Programmable Logic practice questions

50 Practice Questions in 5 sets

Set 1: Decode banks and protect stored words10 Practice Questions

Question 1 of 10

A register file must read two independently addressed words in the same cycle. How many independent read ports are required?
  1. One read port
  2. Two read ports
  3. Three read ports
  4. Four read ports
Show answerHide answer
Answer: B
Each read port supplies its own address path, so two independent addresses need two read ports for simultaneous reads. A single port can select only one word at a time in the same access interval. A write port does not add another independent read path.

Question 2 of 10

In a simple decoder comparison, 16,384 word locations are arranged as 128 rows by 128 columns. How many decoder output AND gates are used by the two selectors together?
  1. 128 gates
  2. 16,384 gates
  3. 512 gates
  4. 256 gates
Show answerHide answer
Answer: D
Each 7-to-128 decoder has 128 output AND gates, so the row and column selectors use 256 together. The 16,384 value counts locations and the outputs of a full linear decoder. Coincident decoding reduces selection logic without reducing the number of stored locations.

Question 3 of 10

Four 8K×8 chips form a 32K×8 memory starting at address zero. What are the selected chip number and internal address for 0x5C20?
  1. Chip 2; internal address 0x1C20
  2. Chip 1; internal address 0x1C20
  3. Chip 2; internal address 0x5C20
  4. Chip 3; internal address 0x0C20
Show answerHide answer
Answer: A
Each chip covers 0x2000 addresses. Address 0x5C20 lies in chip 2’s range 0x4000–0x5FFF, and subtracting its base gives internal address 0x1C20. Sending 0x5C20 as the internal address keeps the bank-selection bits that the smaller chip does not accept.

Question 4 of 10

Data 1100101 will be stored with an odd-parity bit appended on the right. What eight-bit word should be stored?
  1. 11001010
  2. 11001001
  3. 11001011
  4. 11001101
Show answerHide answer
Answer: C
The data contains four ones, so an appended one makes the total five, which is odd. The stored word is 11001011, with all seven data bits preserved. Appending zero gives 11001010 and implements even parity instead; parity generation adds a check bit without changing any data bit.

Question 5 of 10

An even-parity memory word has exactly four flipped bits when read. What does its parity checker report?
  1. A located bit error
  2. A parity failure
  3. Four bits corrected
  4. No error detected
Show answerHide answer
Answer: D
Each flip toggles parity, so four flips return the stored word to its original even parity. The checker therefore reports no error detected even though four bits are wrong. A parity failure occurs for an odd number of flips, and a single parity bit never identifies where to correct a word.

Question 6 of 10

A word has 20 data bits. What is the minimum number of Hamming check bits, before overall parity is added?
  1. 4
  2. 5
  3. 6
  4. 7
Show answerHide answer
Answer: B
Four checks provide 16 patterns, fewer than the 25 cases needed for 24 positions plus no error. Five checks provide 32 patterns for 26 cases, so five is the minimum. Counting only the data bits misses the fact that check-bit errors also need identifiable positions.

Question 7 of 10

Use even-parity Hamming coding with positions numbered left to right from 1 and checks at powers of two. Data 1101 fills the other positions left to right. What is the seven-bit code word?
  1. 0110101
  2. 1011101
  3. 1010101
  4. 1101001
Show answerHide answer
Answer: C
The data fills positions 3, 5, 6, and 7 as 1, 1, 0, 1. The check values at 1, 2, and 4 are 1, 0, and 0, giving 1010101. The result 0110101 swaps the first two check values; their groups differ, so that word does not satisfy every even-parity check.

Question 8 of 10

A seven-bit even-parity Hamming word is read as 0110111, with positions numbered left to right from 1. Exactly one bit flipped. What data is recovered after correction?
  1. 1011
  2. 0011
  3. 1111
  4. 0101
Show answerHide answer
Answer: A
Checks over groups 1, 2, and 4 give 1, 0, and 1, so the syndrome in descending weight order is 101, or position 5. Flipping that position restores 0110011, whose data at positions 3, 5, 6, and 7 is 1011. Reading 1111 directly from the received data positions skips the correction step.

Question 9 of 10

Two 16K×8 chips occupy a 16-bit address bus. Bit 14 selects the chip, bits 13–0 enter it, and bit 15 is ignored. What other address reaches the same stored word as 0x27A0, and what is the physical total capacity?
  1. 0x67A0; 32 KiB
  2. 0xA7A0; 32 KiB
  3. 0xA7A0; 64 KiB
  4. 0x07A0; 16 KiB
Show answerHide answer
Answer: B
Toggling ignored bit 15 adds 0x8000 without changing chip selection or the internal address, giving alias 0xA7A0. The two chips physically store 32 KiB. The 64 KiB address space repeats that storage; it does not create extra cells. Address 0x67A0 changes the decoded chip-select bit instead.

Question 10 of 10

A SEC-DED checker reports nonzero Hamming syndrome and an even overall parity check. What should it do for a word with at most two flipped bits?
  1. Report a double error without correction
  2. Correct the bit named by the syndrome
  3. Correct only the overall parity bit
  4. Accept the word without an error report
Show answerHide answer
Answer: A
Nonzero syndrome shows a Hamming-group inconsistency, while unchanged overall parity indicates an even number of flips. Within the stated two-error limit, that combination identifies a double error. Flipping the syndrome position would apply the single-error rule and could introduce a third bad bit.
Set 2: Size memories and trace their signals10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

A logic-model 8×5 RAM has one enabled address decoder and OR-based column outputs. How many cells and column OR gates does it need?
  1. 40 cells and 8 OR gates
  2. 13 cells and 5 OR gates
  3. 40 cells and 5 OR gates
  4. 40 cells and 40 OR gates
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

A memory has 64 rows and 16 word locations per row. Consecutive addresses run across a row before advancing to the next. Where is address 729?
  1. Row 11, column 25
  2. Row 45, column 9
  3. Row 46, column 9
  4. Row 9, column 45
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A DRAM model has 4,096 rows and requires every row to be refreshed within 32 ms. What interval gives an evenly spaced one-row-at-a-time schedule?
  1. 0.0078125 µs
  2. 128 µs
  3. 7.8125 ms
  4. 7.8125 µs
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A RAM contains 8,192 words, each 24 bits wide. How many address lines does it need?
  1. 12 address lines
  2. 18 address lines
  3. 13 address lines
  4. 24 address lines
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

A sensor buffer is organized as 16K×24. What is its capacity in KiB?
  1. 48 KiB
  2. 16 KiB
  3. 24 KiB
  4. 384 KiB
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

An asynchronous RAM has a 19 ns access time. Its address and read controls become stable at 6 ns. When is the read word first guaranteed valid?
  1. At 19 ns
  2. At 13 ns
  3. At 38 ns
  4. At 25 ns
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A controller runs at 80 MHz and starts memory operations only on clock edges. The RAM has a 31 ns minimum cycle time. What is the shortest whole number of periods between operation starts?
  1. 2 periods
  2. 3 periods
  3. 4 periods
  4. 5 periods
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A memory stores bits as capacitor charge. What periodic operation preserves its data while power remains on?
  1. Refresh the stored rows
  2. Reload its firmware
  3. Toggle its output enable
  4. Reset its address register
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

A designer needs 96K×16 using 32K×8 chips. Only addresses 0x00000–0x17FFF are valid. How many chips are needed, and what should happen for upper address bits 11?
  1. Eight chips; select bank four
  2. Six chips; repeat bank three
  3. Six chips; select no bank
  4. Three chips; select no bank
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A RAM read starts at 0 ns with access time 27 ns and minimum cycle time 46 ns. A 125 MHz controller captures on clock edges and starts its next operation on the first edge after both requirements are met. What are the earliest capture and next-start times?
  1. Capture 24 ns; next start 48 ns
  2. Capture 32 ns; next start 48 ns
  3. Capture 32 ns; next start 40 ns
  4. Capture 48 ns; next start 48 ns
Show answerHide answer

Save this lesson to see this answer.

Set 3: Implement tables and sum-of-products logic10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

A device must retain its programmed table without power and allow electrical erase by byte. What ROM type matches that erase method?
  1. Mask ROM
  2. EPROM
  3. Flash memory
  4. EEPROM
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

An abstract ROM contains 128 words of 12 bits. How many address inputs and programmable output crosspoints does it have?
  1. 12 inputs and 1,536 crosspoints
  2. 7 inputs and 1,536 crosspoints
  3. 7 inputs and 128 crosspoints
  4. 8 inputs and 1,024 crosspoints
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A five-input combinational circuit has six outputs. Two outputs are constants and one is a direct copy of an input. What ROM organization stores only the remaining outputs?
  1. 32×6
  2. 16×3
  3. 32×3
  4. 8×3
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

In a PLA programming table with columns A, B, C, what input pattern represents the product A′C?
  1. 0, –, 1
  2. 0, 0, 1
  3. 1, –, 1
  4. –, 0, 1
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

Two outputs are F=AB+CD and G=AB+CE. How many distinct product terms does a PLA need for these expressions?
  1. 2 terms
  2. 3 terms
  3. 4 terms
  4. 5 terms
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A PAL output pin inverts its internal OR sum. The required pin function is F=AC. What minimized SOP should be programmed internally?
  1. AC
  2. A′C′
  3. A+C
  4. A′+C′
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A PAL has three noninverting outputs with three logic terms each and feedback from every output. Required function H has five minimal SOP terms. A chosen partition is X=t1+t2+t3 and H=X+t4+t5. What resources and path depth does this implementation use?
  1. Two outputs, six terms, two array passes
  2. Two outputs, five terms, two array passes
  3. One output, five terms, one array pass
  4. Three outputs, six terms, three array passes
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

An enabled two-bit up-counter currently holds 10. Enable is one at the next shared clock edge. What state should the two registered macrocells produce?
  1. 00
  2. 01
  3. 11
  4. 10
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

A four-bit input represents 0–15. A ROM-based circuit outputs three times that value in binary. Its least significant output is wired directly from the least significant input. What is the smallest stored table width after removing that one output?
  1. 16×4
  2. 16×5
  3. 32×5
  4. 16×6
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A GAL22V10 must implement three independent minimized SOPs needing 15, 13, and 9 logic terms, with no factoring or feedback. What macrocell term capacities allow all three to fit?
  1. 14, 16, and 10 terms
  2. 16, 12, and 12 terms
  3. 16, 14, and 10 terms
  4. 16, 14, and 8 terms
Show answerHide answer

Save this lesson to see this answer.

Set 4: Map FPGA resources and diagnose faults10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

In an even-parity Hamming code with 26 data bits, how many Hamming checks and how many total stored bits are needed before overall parity?
  1. 5 checks, 31 stored bits
  2. 4 checks, 30 stored bits
  3. 6 checks, 32 stored bits
  4. 5 checks, 32 stored bits
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

How many stored output bits does one five-input LUT contain?
  1. 32 bits
  2. 5 bits
  3. 25 bits
  4. 64 bits
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A configured SRAM-based FPGA is switched off and then powered again. What must happen before it implements the intended user circuit?
  1. Erase its antifuse connections
  2. Rewrite every external RAM word
  3. Reload its configuration bitstream
  4. Rebuild its configuration from input pins
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A three-input LUT implements F=A′B+AC, with A as the most significant address bit. What hexadecimal contents result when address 7 is written first?
  1. 0x35
  2. 0xAC
  3. 0xCA
  4. 0x53
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

A general eight-input Boolean function is implemented using seven-input LUTs. How can one input be used to split the design into two cases?
  1. One seven-input LUT with two outputs
  2. Eight seven-input LUTs in a serial chain
  3. Two seven-input LUTs whose outputs are ORed
  4. Two seven-input case LUTs and a selector
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

During FPGA implementation, what step assigns already mapped logic elements to physical sites on the chip?
  1. Synthesis
  2. Technology mapping
  3. Placement
  4. Timing analysis
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A twelve-position Hamming word plus overall parity is read. Exactly two bits flipped: position 5 and the extra overall parity bit. What are the syndrome and overall parity check, and what action follows?
  1. Syndrome 5, even overall; report double error
  2. Syndrome 5, odd overall; correct position 5
  3. Syndrome 0, odd overall; correct the extra bit
  4. Syndrome 5, even overall; correct position 5
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A PLA offers complemented output polarity. Desired functions are F=(AB+AC)′ and G=AB+D. What is the fewest distinct product rows for a joint implementation?
  1. 2 rows
  2. 4 rows
  3. 5 rows
  4. 3 rows
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

A 64K×32 memory is built from 16K×8 chips with full decoding. For address 0xB642, what bank number and internal word address are selected, and how many chips in that bank operate together?
  1. Bank 2, address 0xB642, four chips
  2. Bank 2, address 0x3642, four chips
  3. Bank 1, address 0x3642, four chips
  4. Bank 2, address 0x3642, one chip
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A design needs a synchronous 2,048×16 memory. Each available 18 Kb block can be configured as 1,024×18. A designer proposes one block because 16 is less than 18. What is the smallest allocation that meets the requirement?
  1. One block, with two output bits unused
  2. Two blocks in width, sharing one address
  3. Four blocks, one for each 512-word range
  4. Two blocks in depth, selecting between their read results
Show answerHide answer

Save this lesson to see this answer.

Set 5: Resolve timing, coding, and logic constraints10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

What happens to a mask ROM’s stored contents when its supply power is removed?
  1. They reset to zeros
  2. They need refresh
  3. They remain stored
  4. They go high impedance
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

A one-bit DRAM is arranged as 512 rows by 2,048 columns and sends the row and column in two parts over shared address pins. What are its logical address width and minimum address-pin count for these parts?
  1. 20 logical bits and 10 shared pins
  2. 20 logical bits and 11 shared pins
  3. 11 logical bits and 11 shared pins
  4. 20 logical bits and 20 shared pins
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

Even-parity Hamming coding stores ten data bits, with the leftmost data bit placed first in non-check positions numbered from 1. The data is 1010110011. What are checks P1, P2, P4, P8?
  1. 0, 1, 1, 0
  2. 1, 1, 1, 0
  3. 1, 0, 0, 0
  4. 1, 0, 1, 0
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A valid extended Hamming word has exactly two errors at Hamming positions 6 and 13; the extra overall parity bit does not flip. What syndrome and overall check appear, and what should the decoder do?
  1. Syndrome 11, even overall; report double error
  2. Syndrome 7, even overall; report double error
  3. Syndrome 11, odd overall; correct position 11
  4. Syndrome 11, even overall; correct position 11
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

A 200 MHz controller starts a read at 0 ns. Access time is 18 ns, the receiving register needs 3 ns setup, and memory cycle time is 28 ns. Capture and operation starts occur only on rising edges. What are the earliest capture and next-start times?
  1. Capture 20 ns; next start 30 ns
  2. Capture 25 ns; next start 30 ns
  3. Capture 25 ns; next start 25 ns
  4. Capture 30 ns; next start 35 ns
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

Two active-low PAL pins must implement F=AB and G=AC. Each has two logic terms and no feedback is used. How many logic terms are programmed across their groups?
  1. 2 terms
  2. 3 terms
  3. 4 terms
  4. 6 terms
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A three-input LUT outputs one exactly when an odd number of A, B, C are one. A is the most significant address bit, and the hexadecimal contents list address 7 first. What contents are required?
  1. 0x96
  2. 0x69
  3. 0xE8
  4. 0x66
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A 48K×24 memory uses 16K×8 chips on a 16-bit address bus. Unused addresses must select no bank. At 0x9234, how many chips operate, what is their internal address, and where does the unused range begin?
  1. Nine chips, 0x1234, unused from 0xC000
  2. Three chips, 0x9234, unused from 0xC000
  3. Three chips, 0x1234, unused from 0xA000
  4. Three chips, 0x1234, unused from 0xC000
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

Control logic must be revised electrically while mounted on its board and retain configuration when power is removed. What device matches both requirements?
  1. An SRAM-configured FPGA with no startup source
  2. A one-time fuse-programmed PAL
  3. A nonvolatile electrically erasable CPLD
  4. A UV-erasable programmable logic device
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

Two FPGA implementations have identical LUT truth tables, but one places connected blocks farther apart and reaches a lower maximum clock frequency. What relationship explains this result?
  1. Placement must increase the Boolean function’s complexity.
  2. Routing delay can rise while LUT functions stay unchanged.
  3. Identical LUT contents require identical total path delays.
  4. Setup timing depends on LUT delay alone, not interconnect.
Show answerHide answer

Save this lesson to see this answer.

Stuck on your own question? Homework Help

Key Terms

84 Key Terms, each with its definition

A

Access time
Access time is the delay from applying a new address under valid read control until the selected data is valid at the outputs.
With 22 ns access time, a read started at zero cannot guarantee valid output at 20 ns.
Active-low output
An active-low output is asserted at zero; in the PAL16L8 output model, the pin carries the inverse of its internal OR sum.
To produce AND at the PAL16L8 active-low output, program the complement internally.
Address aliasing
Address aliasing occurs when different external addresses reach the same stored word because some address bits do not affect selection.
Ignoring bit 17 causes address aliasing between locations separated by 0x20000.
Address map
An address map assigns address ranges to memory banks or devices, showing which storage responds to each valid address.
One address map places a ROM below 0x8000 and a RAM from 0x8000 through 0xFFFF.
Address multiplexing
Address multiplexing sends different parts of one logical address at separate times through the same physical address pins.
DRAM address multiplexing can send a ten-bit row followed by a ten-bit column over ten pins.
Antifuse
An antifuse is a one-time programmable connection technology that changes a selected connection permanently during programming.
An antifuse FPGA retains its circuit without power but cannot load a different configuration later.
Asynchronous RAM
An asynchronous RAM responds directly to address, data, and control signals and has no clock input governing their acceptance.
An asynchronous RAM still needs timed control signals even when its controller uses a clock.

B

Binary cell
A binary cell is a one-bit storage element with selection, read/write control, and data input and output in the logic model.
Sixteen binary cells can be grouped into a four-word RAM with four bits in each word.
Bit line
A bit line is a shared path along a memory-array column that carries a selected cell’s bit to or from the read/write circuitry.
Read circuitry at the end of a bit line replaces the large OR gate in a simplified array model.
Bitstream
A bitstream is configuration data that selects an FPGA’s logic functions, interconnect, and resource operating settings.
An SRAM-based FPGA loads its bitstream again after power-up because configuration is volatile.
Block RAM
Block RAM is dedicated synchronous memory embedded in an FPGA, offering denser storage than ordinary LUT-based logic.
A 1,024-by-16 buffer fits an available 1,024-by-18 block RAM organization.
Bus contention
Bus contention occurs when multiple enabled outputs drive the same shared data wire at once and may demand incompatible levels.
Proper bank decoding and high-impedance inactive outputs prevent bus contention during a read.

C

Carry chain
A carry chain is dedicated fast logic linking neighboring FPGA arithmetic stages to propagate carry for addition and counting.
An FPGA counter can use a carry chain instead of ordinary routing for every carry connection.
CAS
CAS, the column address strobe, marks the column part of an address during the multiplexed address sequence of a DRAM.
The DRAM receives the column selection when CAS marks that part of the address sequence.
Check bit
A check bit is redundant information stored with data to test a defined relationship that helps detect or locate errors.
Each Hamming check bit makes one specified group of positions have even parity.
Chip select
Chip select is a control input that enables a memory device to participate in a read or write at the applied address.
The bank decoder asserts chip select only for the chips supplying the requested word.
Code word
A code word is the complete encoded bit sequence stored or transmitted, containing both data bits and their check bits.
Extracting data from a Hamming code word skips positions 1, 2, 4, 8, and other check positions.
Coincident decoding
Coincident decoding selects a location jointly with row and column decoders, reducing the size of the decoding logic.
A 32-by-32 layout uses coincident decoding with two 5-to-32 selectors.
Column address
A column address is the portion of a memory address that selects the required location or output group within a row.
In a layout with 32 locations per row, the column address is the remainder after division by 32.
CPLD
A CPLD, or complex programmable logic device, connects multiple PAL-like macrocell blocks through programmable interconnect.
A nonvolatile CPLD can provide control logic without loading an external bitstream at every startup.
Crosspoint
A crosspoint is a possible connection where an input or product line crosses another line in a programmable logic array.
An × marking a crosspoint means a connection is programmed; it does not denote inversion.
Cycle time
Cycle time is the minimum allowed interval between the starts of two successive memory operations, including recovery.
A 38 ns cycle time requires four 10 ns clock periods between operation starts.

D

Depth expansion
Depth expansion combines chip banks occupying different address ranges to increase word count without changing word width.
Depth expansion uses upper address bits to select a bank and lower bits to address inside it.
Distributed RAM
Distributed RAM is small memory made from FPGA LUT storage in logic blocks that support writable memory configuration.
A supported six-input LUT can provide a 64-word, one-bit distributed RAM.
DRAM
DRAM, or dynamic RAM, stores each bit as capacitor charge that must be restored regularly because the charge leaks.
A large DRAM array trades the need for refresh for smaller storage cells and high density.
DSP block
A DSP block is dedicated FPGA arithmetic hardware containing multiplication and addition resources for numerical operations.
A multiply-accumulate path can use a DSP block instead of rebuilding its multiplier from LUTs.

E

EEPROM
An EEPROM is nonvolatile memory that can be erased and rewritten electrically, typically in byte-sized updates.
EEPROM can hold a small setting that must be updated without ultraviolet erasure.
EPROM
An EPROM is a reprogrammable nonvolatile memory erased by ultraviolet light through a window before it is written again.
An EPROM requires UV erasure, unlike devices designed for electrical erase on the board.
Even parity
Even parity is the convention in which data and its parity bit together contain an even total number of one-valued bits.
Data with three ones needs a one-valued check bit to give even parity after it is appended.

F

Feedback
Feedback returns a programmed output or stored state to the input side of a device so another logic function can use it.
PAL feedback can combine partial results, but the extra array pass adds signal delay.
Flash memory
Flash memory is dense nonvolatile storage with electrical block erasure, used for firmware, configurations, and data.
Flash memory can retain an FPGA bitstream for the next startup of an SRAM-based device.
FPGA
An FPGA, or field-programmable gate array, is a chip of configurable logic blocks, programmable routes, and configurable I/O.
An FPGA can implement parallel data-processing circuits by configuring its blocks and connections.

H

Hamming code
A Hamming code uses overlapping parity groups whose check results uniquely identify any single faulty stored position.
A Hamming code for eight data bits uses four checks to form a twelve-bit stored word.
Hard error
A hard error is a stored-bit failure caused by a permanent fault, so rewriting the word does not remove the underlying defect.
A cell that repeatedly returns the wrong bit after rewrites indicates a hard error.
High impedance
High impedance is an output state that releases a wire instead of actively driving a zero or one, allowing another device to drive it.
An inactive memory bank uses high impedance while the selected bank supplies the data bus.
Hold time
Hold time is the minimum interval for which a signal must remain stable after the specified sampling or write-ending event.
The controller keeps write data unchanged briefly after the event to satisfy hold time.

I

I/O block
An I/O block configures the connection between internal logic and a package pin, including direction and electrical behavior.
A bidirectional I/O block uses three-state control to release its pin when another device drives it.
In-system programming
In-system programming changes a device’s programmed configuration while the device remains mounted on its circuit board.
A board can expose a JTAG connection for in-system programming of a supported logic device.

K

KiB
A KiB, or kibibyte, is 1,024 bytes, using a binary prefix that distinguishes it from the 1,000-byte SI unit kB.
A buffer containing 4,096 bytes has a capacity of four KiB, not four kB.

L

Linear decoding
Linear decoding uses one decoder output per word, expanding a binary address directly into a complete set of word selections.
For 1,024 words, linear decoding needs a 10-to-1,024 decoder with 1,024 selection outputs.
LUT
A LUT, or lookup table, is a small memory whose input bits address stored output bits that implement a Boolean function.
A six-input LUT stores 64 bits and can implement a six-input XOR as one table lookup.

M

Macrocell
A macrocell combines one output’s product-term logic with a flip-flop and selections for registration, polarity, and feedback.
A registered macrocell can store one bit of a counter and return that state to the next-state logic.
Mask ROM
A mask ROM has its contents fixed during chip manufacture and is suited to unchanged data produced in large quantities.
A mask ROM cannot receive a new stored table through a later electrical programming operation.
Memory address
A memory address is the binary number that identifies a word location independently of the value stored in that location.
Writing a new value at memory address 12 replaces its contents without changing its location.
Memory bank
A memory bank is one chip or a selected group of chips that supplies the complete word for a range in a combined memory.
A sixteen-bit memory bank can contain two eight-bit chips enabled together.
Memory capacity
Memory capacity is the total stored information, found by multiplying the word count by the number of bits in each word.
A 2,048-word memory with eight bits per word has a memory capacity of 16,384 bits.
Memory port
A memory port is an independent address and data access path through which an operation can reach a selected word.
Two read memory ports can supply independently selected source words in the same cycle.
Memory word
A memory word is a group of bits stored at one address and accessed together through the memory’s data interface.
In a sixteen-bit memory word, one read returns all sixteen bits from the selected address.
Miscorrection
A miscorrection is a decoder action that changes the wrong bit after interpreting an error pattern as a different correctable fault.
Plain Hamming correction can cause a miscorrection when two errors imitate a single-error syndrome.

O

Odd parity
Odd parity is the convention in which data and its parity bit together contain an odd total number of one-valued bits.
Data containing four ones needs a one-valued check bit when odd parity is used.
Output polarity
Output polarity specifies whether the pin carries an internal logic result directly or carries its complement through inversion.
Complemented output polarity can let a PLA implement a simpler SOP for a function’s complement.
Overall parity
Overall parity is a parity relationship covering the entire Hamming word and one extra bit to distinguish SEC-DED error cases.
Two flipped bits preserve overall parity even though the Hamming syndrome becomes nonzero.

P

PAL
A PAL, or programmable array logic device, has a programmable AND array with product terms assigned to fixed output OR groups.
A PAL must duplicate a common product when two output groups both need that logical term.
Parity bit
A parity bit is an added check bit chosen to make the total number of ones in the stored word follow an even or odd rule.
The generator sets the parity bit before the word is stored, and the checker includes it on a read.
Parity group
A parity group is the set of stored positions covered by one check, with membership fixed by the code’s position rules.
Hamming position 6 belongs to parity groups 2 and 4 because its binary index is 0110.
PLA
A PLA, or programmable logic array, forms selected products in a programmable AND array and sums them in a programmable OR array.
A PLA can connect one shared product to two different output sums without duplicating the product row.
Placement
Placement assigns mapped FPGA resources to physical chip locations before routing establishes their signal connections.
Placement can shorten a critical connection by locating related logic blocks close together.
Product term
A product term is an AND of selected true or complemented inputs that forms one contribution to a sum-of-products function.
The product term AC leaves B unrestricted because B is absent from that AND expression.
Product-term limit
A product-term limit is the maximum number of logic products that a particular output group or allocation can combine.
A PAL output with a seven-term product-term limit cannot directly hold an eight-term SOP.
Programmable routing
Programmable routing connects FPGA resources through wire segments and configuration-controlled switches that define signal paths.
Long programmable routing between two placed blocks can limit the design’s clock frequency.
Programming table
A programming table lists selected input forms for each product and the output sums receiving that product in an array device.
In a PLA programming table, 1 selects true, 0 selects complement, and a dash omits an input.
PROM
A PROM is a nonvolatile programmable read-only memory written once by the user, classically by altering fuse connections.
A programmed PROM keeps its data without power but has no erase-and-rewrite procedure.

R

RAS
RAS, the row address strobe, marks the row part of an address during the multiplexed address sequence of a DRAM.
In the row-column interface model, RAS identifies the row before CAS identifies the column.
Read latency
Read latency is the specified delay between accepting a read request and providing its result, expressed in clock cycles.
A controller using a clocked memory schedules its receiving logic for the configured read latency.
Refresh
Refresh is the automatic restoration of DRAM row charge before leakage makes the stored information unreliable.
A memory controller schedules refresh operations throughout the allowed retention window.
Register file
A register file is a small multiported memory that holds processor register values and supports simultaneous selected accesses.
A register file with two read ports and one write port can supply two operands and accept a result.
Registered output
A registered output passes its logic result through a flip-flop, holding the captured value between active clock edges.
Two registered outputs sharing a clock use the same edge to capture their next-state bits.
ROM
A ROM, or read-only memory, retains programmed information without power and normally supplies that information through reads.
A ROM can store the output pattern for every address of a character-generation table.
ROM minterm
A ROM minterm is one complete input combination represented by a decoder line that may feed selected output OR gates.
Connecting the ROM minterm for address 5 sets that row’s chosen output bit to one.
Row address
A row address is the portion of a memory address that selects one row under the array’s assigned address-bit convention.
When upper bits form the row address, dividing by the column count gives the selected row.

S

SEC-DED
SEC-DED is a coding capability that corrects every single-bit error and detects every double-bit error using added checks.
A 72-bit SEC-DED word can protect 64 data bits with eight extra check bits.
Setup time
Setup time is the minimum interval for which a signal must be stable before the specified sampling or write-ending event.
A data value that changes too close to write completion can violate its setup time.
Shannon expansion
Shannon expansion expresses a Boolean function as two cases with one input fixed to zero or one, selected by that input.
Shannon expansion divides a seven-input function into two six-input functions and a selector.
Soft error
A soft error is a temporary stored-bit error that disappears when the word is rewritten, without a permanent storage fault.
A radiation-induced bit flip can be a soft error even though the stored result is wrong until repaired.
SRAM
SRAM, or static RAM, holds each bit in a bistable storage element that retains its state without refresh while powered.
A small fast SRAM buffer avoids refresh scheduling but still loses data when power is removed.
Stored output column
A stored output column is the set of ROM bits holding one output value across every input address in a table implementation.
Wiring a constant output directly removes its stored output column from the ROM.
Syndrome
A syndrome is the ordered pattern of Hamming group-check results that names the faulty position when exactly one bit is wrong.
Syndrome 0110 identifies position 6 when the checks are ordered C8C4C2C1.

T

Technology mapping
Technology mapping assigns synthesized logic to the LUTs, flip-flops, and embedded resource types provided by an FPGA.
Technology mapping can select a dedicated DSP resource for an arithmetic operation.
Timing analysis
Timing analysis checks signal-path delays against setup, hold, and interface requirements for the implemented circuit.
A path can fail timing analysis even when the design uses fewer LUTs than the device provides.
Truth-table implementation
A truth-table implementation stores the output for every input pattern, using circuit inputs as memory addresses.
A truth-table implementation of a five-input function needs 32 address rows per stored output bit.

U

Unused input code
An unused input code is an address pattern excluded from intended operation whose programmed output can be chosen freely.
A BCD converter gives unused input codes ten through fifteen definite stored words.

V

Volatile memory
Volatile memory requires power to retain its stored information and loses that information when its power is removed.
SRAM and DRAM are volatile memory, even though only DRAM needs periodic refresh while powered.

W

Width expansion
Width expansion combines chips on different data-bit slices so they jointly supply a wider word at each shared address.
Four eight-bit chips used for width expansion can produce one 32-bit word.
Word line
A word line is a decoded selection line that activates the cells belonging to one addressed word or physical row.
One word line selects all four cells of the addressed word in a four-by-four logic model.

About this lesson

By StudeliReport a mistake

Make your own Study Materials

Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.

Get Started