← Advanced course and all videos

Video 3 of 53 · 5:34 · Foundations and representations

A truth function in a matrix layout

In this video

  1. 0:00 · Introduction
  2. 0:15 · Turn a complete assignment into an address
  3. 1:21 · Core explanation
  4. 3:21 · Track an output-zero assignment through the grid
  5. 4:24 · Move the layout without changing the answers
  6. 5:25 · Direct takeaways

Caption transcript

Show transcript
This overview explains how ordered row and column variables place each assignment and its output in an explicit matrix. Without the axis key, a coordinate does not identify the input case, even when the stored bit is correct. For this four-input layout, declare zero-first binary order on both axes. The row receives A and B, while the column receives C and D. This choice differs from the true-first convention used for the small operator matrices; the labels, rather than memory, determine the address. For assignment one zero one one, the row bits are one zero, which represent two. The column bits are one one, which represent three. A and B gives zero, C or D gives one, and exclusive-or gives one. Place that answer at row two, column three. Keep the row fixed and walk across all four columns. The first branch remains zero. The second branch gives zero, one, one, one, so exclusive-or returns that same sequence. Filling a row means evaluating every column assignment; it is more work than looking up one cell. First compute A AND B and C OR D. The function takes the exclusive-or of those two results. Assignment 1011 produces output one. Choose ordered row variables A, B and column variables C, D. Read each pair most-significant bit first. Row bits 10 give 1 × 2 + 0 × 1: row two. Column bits 11 give column three. A AND B is zero and C OR D is one. Their exclusive-or is one, so cell two, three stores one. Evaluate all 16 assignments under the same rule to fill the complete 4×4 layout. The axis key lets us decode row two and column three back into A-B 10 and C-D 11. The coordinate identifies the input; the stored bit gives its output. As another worked example, 1110 selects row three and column two. Both inner results are one, so the stored output is zero. For 0100, row one and column zero store zero. Both inner results are zero. This layout places A on the rows and B-C-D on the columns. One row bit gives two rows; three column bits give eight columns. The tracked assignment 1011 moves to row one, column three and keeps output one. This layout places A-B-C on the rows and D on the columns. The same assignment is at row five, column one in an 8×2 layout. Each layout contains sixteen cells. Changing the partition moves assignment-output pairs without changing their values. These rectangular repository layouts are distinct from the paper's square construction. Work a second complete case with A 1, B 1, C 0, D 1. Keep this assignment fixed throughout the calculation. Each symbol retains the meaning already introduced; a new value does not create a new logical rule. The row address is three and the column address is one in the declared zero-first layout. Both inner branches give one, so exclusive-or gives zero. This cell stores zero even though both branches are true. A matrix lookup and a program trace must agree on that same assignment. This case establishes a specific contrast. Address (3,1) stores 0. The layout does not change the outer gate. Keep the input, intermediate values, and conclusion together when comparing it with the previous case. The calculated answer belongs to this complete assignment under the stated rule. Now change the partition so that rows contain A and C and columns contain B and D. The Boolean rule has not changed. Only the address convention has changed, so every assignment must be relocated consistently. Track the same four-bit assignments through both layouts. One zero one one moves from row two, column three to row three, column one. Zero one zero zero moves from one, zero to zero, two. One one zero one moves from three, one to two, three. Each retains its own output. A matrix position is meaningful only with its declared partition and axis order. Two arrays can look different while encoding the same function under different layouts. Conversely, treating different conventions as identical can compare the wrong assignments and produce a false disagreement. The function determines the output. The ordered axis lists and bit convention determine its position.