00:00:00.000 The sensor now sends a value In lesson one, each sensor reported whether it was too hot. One bit could answer that question. Now the display needs a measurement value. The interface carries eight bits, and the selector must pass the whole group. The rule stays the same: select zero chooses A, and select one chooses B. This lesson follows those bits from their declaration to the value a receiver reads. 00:00:31.755 Eight positions, eight bits The range seven down to zero includes both ends, giving eight positions. Bit zero is on the right and bit seven is on the left. A thick line in the drawing represents the whole group, often called a bus. The range does not add memory. This is still a combinational selector. Its output follows the chosen input, with physical propagation delay determined by the implementation. 00:01:01.340 Two spellings of the same pattern Split the eight bits into two groups of four. The group one one one one is the hexadecimal digit F. The group zero zero zero zero is the digit zero. Together they form F zero. Hexadecimal gives us a shorter way to record the pattern. Changing the notation does not change a single bit on the interface. 00:01:31.720 Write the width and the base In the literal on screen, the leading eight specifies the width. The h after the apostrophe selects hexadecimal, and F zero supplies the pattern. A based literal without the signed marker is unsigned. An ordinary decimal integer has different signedness rules. For circuit data, this course writes the intended width explicitly so the person reading the design can see how many bits are involved. 00:02:05.490 Nine bits meet an eight-bit destination Now the source carries nine bits. A leading one followed by the previous eight bits gives hexadecimal one F zero, or four hundred and ninety-six as an unsigned value. The destination has only eight positions. The assignment keeps the low eight bits and discards the highest bit. The remaining pattern is F zero, which reads as two hundred and forty when unsigned. 00:02:38.110 The discarded information is lost A receiver that sees only F zero cannot tell whether the source was zero F zero or one F zero. Both leave the same low eight bits. Truncation is intentional when the interface asks for those low bits. If the full measurement matters, the destination needs more bits or an explicit policy for values outside its range. The interface must say which information has to survive. 00:03:10.500 Read the pattern as unsigned Return to the eight-bit pattern F zero. In an unsigned reading, every position has a positive weight. The four set positions contribute one hundred and twenty-eight, sixty-four, thirty-two and sixteen. Their sum is two hundred and forty. Eight unsigned bits can represent every integer from zero through two hundred and fifty-five. 00:03:38.930 The same bits can represent minus sixteen If the sensor interface specifies eight-bit two's complement, the highest position has a weight of minus one hundred and twenty-eight. The other seven weights stay positive. Add the four set positions again and the result is minus sixteen. No bits were flipped and no extra minus-sign bit was added. The pattern is unchanged; the interface has defined a different numerical interpretation. 00:04:10.680 Why is there one more negative value? Eight-bit two's complement still has two hundred and fifty-six patterns. The half with a zero high bit represents zero through one hundred and twenty-seven. The other half represents minus one hundred and twenty-eight through minus one. Zero uses one position in the nonnegative half. That explains the asymmetric endpoints. With four bits, sixteen patterns cover minus eight through seven. 00:04:40.450 Widening while keeping a negative value Suppose the next interface is sixteen bits wide. To preserve the signed value minus sixteen, sign extension copies the original high bit into the new positions. Eight ones appear on the left, and a signed reading still gives minus sixteen. An unsigned source is extended with zeros instead, preserving two hundred and forty. The right-hand source expression determines which extension is used. 00:05:13.760 A full slice loses signedness The wrong version appears to take all eight bits, but it adds an explicit part-select. Under the language rules, a part-select is unsigned even when it covers the entire signed vector. Widening that expression adds zeros, turning the intended minus sixteen into two hundred and forty. The repair uses the original signed source directly, allowing the assignment to preserve its value. 00:05:44.725 Declarations and their drivers The signal description must also identify its driver. Lesson one declared a wire net and used a continuous assignment to drive it. SystemVerilog also permits one continuous assignment to drive a logic variable. A procedural description assigns to a variable through its procedure. Keep the declaration and its driver together when reading the design. Later lessons will build more elaborate decision logic on that foundation. 00:06:15.590 The name reg does not imply storage Older Verilog uses reg for variables assigned by procedures. In this example, every selection branch assigns an output, so the description is combinational. The actual synthesis result is an eight-bit mux with no register cells. Whether a circuit retains data follows from its behavior, not the spelling of its variable type. Clocked storage will be introduced in lesson seven. 00:06:45.055 X and Z in simulation Four-state simulation can show unknown and high-impedance states as well as zero and one. In this experiment, an uninitialized logic variable shows X, and an undriven wire shows Z. X says the simulator cannot determine a logic value; it is not an extra fixed voltage on a chip. Z models a high-impedance driver state. Start debugging by checking initialization, drivers and connections. 00:07:17.750 Test the range, then repair the bug The download interprets all two hundred and fifty-six eight-bit patterns and checks truncation for all five hundred and twelve nine-bit inputs. The correct widening design passes. The deliberately unsigned slice fails for one hundred and twenty-eight inputs, the half whose high bit is one. These are actual simulation results. The browser inspector explains the relationships; rerunning the source checks what the tools really do. 00:07:51.655 Leave a clear signal contract A useful interface contract records the signal name, width, numerical format and driver. If high bits are discarded, it also says whether that loss is intentional. Return to the inspector, toggle the highest bit and compare the two readings of the same pattern. Then repeat the reasoning with four bits. The next lesson uses these values in conditions so a circuit can decide which data to accept.