CSE241 Digital Systems
Date | Topic | Chapter | Classnotes |
---|---|---|---|
8/28 | Course Goals and Plans | Course description | |
8/30 | Number System | Chapter 1 | C1 |
9/1,6 | Signed Arithmetic | Chapter 1 | C2 |
9/8 | Boolean Algebra | Chapter 2 | C3 |
9/11 | Floating Point Representation | Chapter ? | C4 |
9/13,15 | Problem Solving using Logic Gates | Chapter 2 | C5 |
9/18 | Karnaugh Map | Chapter 3 | C6 |
9/20 | Problem Solving using K-Maps: 7Seg LED display | Chapter 3 | C7 |
9/22,25 | Analysis of Logic Circuit; SSI, MSI, LSI | Chapter 4 | C8 |
9/27 | MSI: Decoder | Chapter 4 | C9 |
9/29 | MSI: Multiplexer | Chapter 4 | C10 |
10/2 | MSI: Comparator, Carry Look ahead Adder | Chapter 4 | C11 |
10/6,10/9 | REVIEW, In-class REVIEW | Chapter 1-4 | C12 |
10/11 | Exam 1 | Chapter 1-4 | Review |
10/13,18 | Chapter 5 | C13 | |
10/20-27 | Sequential Circuit Synthesis | Chapter 5 | C14 |
11/1 | Hardware Description Language: Verilog | Chapter 3-5 | C15 |
11/8 | Hardware Description Language: Verilog | Chapter 3-5 | C17 |
11/8 | Field Programmable Logic Array | Chapter 7 | C18 |
Consider a pack of playing cards, a set of coins: how do understand these systems? How do you model them so that a computer can understand?
We think in decimal, computers number crunch in binary
How do you define a number system?
Radix of a number system?
Number conversion
Decimal to binary, binary to decimal
Numbers with fractions
ASCII 7-bit code for information representation
Notes
ASCII 7-bit code for representation of characters.. standard code
BCD for binary form of decimal
Representing numbers for efficient computation: 1's complement and 2's complement
In general, lot of research effort on "coding" information for efficient and reliable processing: excess-3 code, Gray code
Binary arithmetic: sign-magnitude vs. 2's complement
Signed Binary Arithmetic Consider numbers A = 53 and B= 76. Assume positive numbers are represented using sign-magnitude and negative numbers as 2's complement. Perform the operations below in binary. Assume 8-bit container. Specify if the result is positive, negative or overflow and explain your answer.
- X = A + B
- Y = A - B
- Z = -A -B
- W = -A + B
Notes
Boolean algebra is like any other math system: Set of elements, set of operators, and a number of axioms and postulates.
Basic operations {AND, OR, NOT} {.,+,'}
Algebraic simplification: goal is to minimize the Boolean function to minimum number of literals and minimum number of terms. We will use only sum of products form.
Lets review what we did last class.
What is simplification of a Boolean expression? Goal of simplification is to minimize the number of literals and also the number of terms in an
expression. We will look at algebraic simplification by applying the laws and theorems.
We will implement the Boolean expressions uisng logic gates. {AND, OR, NOT} combiation and also using only NAND gate. We will also implelemt the circuits using common IC chips.
Logic gates are used to implement Boolean functions. For the gates, study it through the name of the gate, logic operator, graphic symbol, truth table and expression representing the operation of a gate.
We will discuss implementation of Boolean functions. Here are the steps in the design and implementation of a Boolean function.
Problem Statement: Design a combinational logic circuit to generate odd parity for the BCD code; a logic circuit that will generate the odd parity bit for any 4-bit combination of the BCD code. Implement it using (i) {AND, OR, NOT} and (iii) using only NAND gates.
We will explore K-maps for 2-3-4-variable functions.
Lets review logic gates.
Problem Statement: Design and implement the logic circuit for BCD-7-segment display.
Input: 0,1,2..9
Output: 7-segment display for the input digit.
So far we synthesized or designed and constructed circuits. Today we will learn how deconstruct and analyze a combinational circuit.
See figure 4.2, p.128. Fifth Edition.
We will discuss SSI, MSI and LSI.
Start looking at MSI chips and design a half-adder.
We will learn design and implementation of (i) Comparator (ii) Carry Look-ahead adder. We will also learn an alternative way to implement circuits using only NAND gates.
We will study sequential circuits using
Here it is. The question by question analysis of your midterm performance;
Characteristic table describes the effect JK on state. State table explain the state transtions from A(t) to A(t+1) and the FF inputs that bring about the change.
Lets work on problem 5.9.
Lets review steps in analysis of sequential circuit (i) analysis (ii) design.
// Sequential Circuit Example 5_20 : the instantiation is inside
// the test bench
// item 1
module counter2 (output y, input x, input clock,input reset);
// item 2
reg[1:0] state; // 2 bits
// item 3
parameter S0=2'b00, S1 = 2'b01, S2=2'b10, S3=2'b11;
//item 4 when and how do the state transitions happen?
always@ (posedge clock, negedge reset)// event driven
if (reset == 0) state <= S0;
else case (state)
S0 : if(x==1) state <= S1; else state<= S0;
S1 : if(x==1) state <= S2; else state<= S1;
S2 : if(x == 1) state <= S3; else state<= S2;
S3 : if(x == 1) state <= S0; else state<= S3;
endcase // case(state)
// item 5 : output
assign y = (state==S3);
endmodule // counter2
module counter2_tb;
// stand alone
// item 1 definitions
reg x, clk, rst;
wire y;
// item 2 instantiate counter2
counter2 C1(y, x, clk,rst);
// item 3
initial #200 $finish; // duration of your simulation testing
// item 4
initial begin
rst = 0;
clk = 0;
#5 rst = 1;
repeat (16)
#5 clk = ~clk;
end
// item 5 for x
initial begin
x = 1'b0;
repeat(8)
#10 x = ~x;
end
// item 6 for montioring, output text and waveform
initial begin
$monitor("x= %d y= %d",x,y);
$dumpfile("example1.vcd");
$dumpvars;
end
endmodule
Actual verilog code can be found at example1.v
iverilog -o example1.vvp example1.v
vvp example1.vvp
gtkwave example1.vcd