L07: Circuit Building Blocks I CSE369, Winter 2017 Intro to Digital Design Circuit Building Blocks I Instructor: Justin Hsia L07: Circuit Building Blocks I CSE369, Winter 2017 Practice: String Recognizer FSM
Recognize the string 101 with the following behavior . Input: 1 0 0 1 0 1 0 1 1 0 0 1 0 . Output: 0 0 0 0 0 1 0 1 0 0 0 0 0 State diagram to implementation:
2 L07: Circuit Building Blocks I CSE369, Winter 2017 Administrivia
Lab 7 – Useful Components . Modifying Lab 6 game to implement common circuit elements • Counter, Shift Registers covered later in lecture . Build a tunable computer opponent . Bonus points for smaller resource usage
Quiz 2 is next week in lecture . First 25 minutes, worth 11% of your course grade . On Lectures 4‐6: Sequential Logic, Timing, FSMs, and Verilog
. Au16 Quiz 2 (+ solutions) on website: Files Quizzes 3 L07: Circuit Building Blocks I CSE369, Winter 2017 Motivating Example
Problem: Implement a simple pocket calculator Need: . Display: Seven segment displays . Inputs: Switches . Math: Arithmetic & Logic Unit (ALU)
4 L07: Circuit Building Blocks I CSE369, Winter 2017 Data Multiplexor
Multiplexor (“MUX”) is a selector . Direct one of many ( = s) ‐bit wide inputs onto output . Called a ‐bit, ‐to‐1 MUX Example: ‐bit 2‐to‐1 MUX . Input S ( bits wide) selects between two inputs of bits each This input is passed to output if selector bits inputs match shown value
5 L07: Circuit Building Blocks I CSE369, Winter 2017 Review: Implementing a 1‐bit 2‐to‐1 MUX
Schematic: Boolean Algebra:
sabc Truth Table: 0 0 00 0 0 10 Circuit Diagram: 0 1 01 0 1 11 100 0 101 1 110 0 111 1 6 L07: Circuit Building Blocks I CSE369, Winter 2017 1‐bit 4‐to‐1 MUX
Schematic:
Truth Table: How many rows? 26 Boolean Expression:
e = s1’s0’a + s1’s0b + s1s0’c + s1s0d
7 L07: Circuit Building Blocks I CSE369, Winter 2017 1‐bit 4‐to‐1 MUX
Can we leverage what we’ve previously built? . Alternative hierarchical approach:
8 L07: Circuit Building Blocks I CSE369, Winter 2017 Multiplexers in General Logic
Implement with a 8:1 MUX
0 1 2 3 4 8:1 5 MUX 6 7 S0 S1 S2
9 L07: Circuit Building Blocks I CSE369, Winter 2017 Review: Unsigned Integers
Unsigned values follow the standard base 2 system . In bits, represent integers to
Add and subtract using the normal “carry” and “borrow” rules, just in binary
63 00111111 64 01000000 +8 +00001000 -8 -00001000 71 01000111 56 00111000
10 L07: Circuit Building Blocks I CSE369, Winter 2017 Review: Two’s Complement (Signed)