Final Project. System Overview Description of Inputs reset: When LOW, a power on reset is performed. mode: When LOW, NORMal mode selected When HIGH,

Slides:



Advertisements
Similar presentations
//HDL Example 8-2 // //RTL description of design example (Fig.8-9) module Example_RTL (S,CLK,Clr,E,F,A);
Advertisements

Counters Discussion D8.3.
Verilog.
Verilog Overview. University of Jordan Computer Engineering Department CPE 439: Computer Design Lab.
Synchronous Sequential Logic
Verilog Descriptions of Digital Systems
Verilog Modules for Common Digital Functions
Table 7.1 Verilog Operators.
//HDL Example 5-1 // //Description of D latch (See Fig.5-6) module D_latch (Q,D,control); output Q; input.
Verilog. 2 Behavioral Description initial:  is executed once at the beginning. always:  is repeated until the end of simulation.
Analysis of Clocked Sequential Circuits
1 EE24C Digital Electronics Project Theory: Sequential Logic (part 2)
Give qualifications of instructors: DAP
//HDL Example 6-1 // //Behavioral description of //Universal shift register // Fig. 6-7 and Table 6-3 module shftreg.
FSM examples.
CS 151 Digital Systems Design Lecture 37 Register Transfer Level
Pulse-Width Modulated DAC
Conditional Statements  if and else if statements if (expression) if (expression) statements statements { else if (expression) { else if (expression)
ENEE 408C Lab Capstone Project: Digital System Design Verilog Tutorial Class Web Site:
Arbitrary Waveform Discussion 12.2 Example 34. Recall Divide-by-8 Counter Use q2, q1, q0 as inputs to a combinational circuit to produce an arbitrary.
Counters Discussion 12.1 Example 33. Counters 3-Bit, Divide-by-8 Counter 3-Bit Behavioral Counter in Verilog Modulo-5 Counter An N-Bit Counter.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Senior Design I Lecture 4 - Verilog 2 (Sequential.
ENEE 408C Lab Capstone Project: Digital System Design Fall 2005 Sequential Circuit Design.
Design example Binary Multiplier.
ELEN 468 Advanced Logic Design
Mantıksal Tasarım – BBM231 M. Önder Efe
Verilog Descriptions of Digital Systems. Electronic Lock // // Electronic combinational lock // module lock(seg7,key, valid_key, col, row, mclk, resetL)
RTL Coding tips Lecture 7,8 Prepared by: Engr. Qazi Zia, Assistant Professor EED, COMSATS Attock.
Sequential Logic in Verilog
Verilog Basics Nattha Jindapetch November Agenda Logic design review Verilog HDL basics LABs.
Verilog Digital System Design Z. Navabi, 2006
Registers & Counters M. Önder Efe
ECE 2372 Modern Digital System Design
Registers CPE 49 RMUTI KOTAT.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
ECE 551 Digital System Design & Synthesis Fall 2011 Midterm Exam Overview.
Chapter 11: System Design Methodology Digital System Designs and Practices Using Verilog HDL and 2008, John Wiley11-1 Ders 8: FSM Gerçekleme ve.
Lab Session 2 Design of Elliptic Curve Cryptosystem
Register Transfer Level & Design with ASM
1 CSE-308 Digital System Design (DSD) N-W.F.P. University of Engineering & Technology, Peshawar.
1 COMP541 Sequential Circuits Montek Singh Feb 1, 2012.
Anurag Dwivedi. Basic Block - Gates Gates -> Flip Flops.
Verilog A Hardware Description Language (HDL ) is a machine readable and human readable language for describing hardware. Verilog and VHDL are HDLs.
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
Digital Electronics.
Introduction to Verilog
ECE/CS 352 Digital System Fundamentals© T. Kaminski & C. Kime 1 ECE/CS 352 Digital Systems Fundamentals Fall 2000 Chapter 5 – Part 2 Tom Kaminski & Charles.
SYEN 3330 Digital SystemsJung H. Kim 1 SYEN 3330 Digital Systems Chapter 7 – Part 2.
Chapter 11: System Design Methodology Digital System Designs and Practices Using Verilog HDL and 2008, John Wiley11-1 Chapter 11: System Design.
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU 99-1 Under-Graduate Project Design of Datapath Controllers Speaker: Shao-Wei Feng Adviser:
SYEN 3330 Digital SystemsJung H. Kim Chapter SYEN 3330 Digital Systems Chapters 4 – Part4: Verilog – Part 2.
EMT 351/4 DIGITAL IC DESIGN Verilog Behavioral Modeling  Finite State Machine -Moore & Mealy Machine -State Encoding Techniques.
Pusat Pengajian Kejuruteraan Mikroelektronik EMT 351/4 DIGITAL IC DESIGN Verilog Behavioural Modeling (Part 4) Week #
1 Lecture 3: Modeling Sequential Logic in Verilog HDL.
Figure Implementation of an FSM in a CPLD..
Supplement on Verilog FF circuit examples
Supplement on Verilog for Algorithm State Machine Chart
Figure 8.1. The general form of a sequential circuit.
Verilog Modules for Common Digital Functions
Supplement on Verilog Sequential circuit examples: FSM
FSM MODELING MOORE FSM MELAY FSM. Introduction to DIGITAL CIRCUITS MODELING & VERIFICATION using VERILOG [Part-2]
6. Registers and Counters
Supplement on Verilog Sequential circuit examples: FSM
Register-Transfer Level Components in Verilog
Dr. Tassadaq Hussain Introduction to Verilog – Part-3 Expressing Sequential Circuits and FSM.
The Verilog Hardware Description Language
332:437 Lecture 9 Verilog Example
332:437 Lecture 9 Verilog Example
332:437 Lecture 9 Verilog Example
Presentation transcript:

Final Project

System Overview

Description of Inputs reset: When LOW, a power on reset is performed. mode: When LOW, NORMal mode selected When HIGH, CONFIG mode selected. clk:Master clock input str:When in NORM mode, this is string to be decypted. Asynchronous input stream. Self-clocking!!! When in CONFIG mode, this will be configuration data. Synchronous input stream!

Modes

CONFIG Mode n4-bit binary value denoting the length of d and N parameters dThe decryption key. It is 2**n bits long. NThis is the modulus. It is also 2**n bits long. Total length of configuration data is 2**(n+1) + 4 bits long!!! Configuration data is synchronized to clk. Legal values of n are between 3 and 10.

Self-clocking (asynchronous) of data in NORM mode Bit period will be at least 50 clock cycles but not more than 1000! If we stay LOW for a complete bit period or HIGH for a complete bit Period (previous bit period) then a break as occurred and you may abort!

Description of Outputs msgThe decypted message. It is exactly 2**n bits long and sync’ed to clock. Changes on this line are in response to rising edge of clk. frameThis output should go HIGH to indicate that there is valid data on the msg pin. Transitions in frame signal should be sync’ed to the rising edge of clk. Should remain high for 2**n clock cycles.

RSA Primer S = s**e modulo N  encrypt s = S**d modulo N  decrypt If d is 13, n is 8, N is 62 and S= 27 then s = (27 ** 13) modulo 62 = 29 Note: 2**8 is 256 so N, s, and S are all 256 bits long.

Verilog Descriptions of Digital Systems

Design Flow

Verilog Lab #3 Design a serial adder circuit using Verilog. The circuit should add two 8-bit numbers, A and B. The result should be stored back into the A register. Use the diagram below to guide you. Hint: Write one module to describe the datapath and a second module to describe the control. Annotate your simvision trace output to demonstrate that the adder works correctly. Demonstrate by adding $45 to $10 in your testbench.

Serial Adder

Controller and Datapath Modules module serial_adder_datapath(sum, sout, sinA, sinB, ctl, reset, clk) ; output [7:0] sum ; output sout ; input sinA, sinB ; input [ ] ctl ; input reset, clk ; endmodule module serial_adder_control(ctl, busy, start, reset, inv_clk) ; output [ ] ctl ; output busy ; input reset, start, inv_clk ; endmodule

Adder/Subtractor Assignment // 4-bit full-adder (behavioral) module fa(sum, co, a, b, ci) ; input [3:0] a, b ; input ci ; output [3:0] sum ; output co ; assign {co, sum} = a + (ci ? ~b : b) + ci ; endmodule

Binary Multiplication

Binary Multiplier

ASM Chart

Numerical Example

Serial Multiplier (Verilog) // multiplier module multiplier(S, clk, clr, Bin, Qin, C, A, Q, P) ; input S, clk, clr ; input [4:0] Bin, Qin ; output C ; output [4:0] A, Q ; output [2:0] P ; // system registers reg C ; reg [4:0] A, Q, B ; reg [2:0] P ; reg [1:0] pstate, nstate ; parameter T0 = 2'b00, T1= 2'b01, T2 = 2'b10, T3 = 2'b11 ; // combinational circuit wire Z ; assign Z = ~|P ; // state register process for controller clk or negedge clr) begin if (~clr) pstate <= T0 ; else pstate <= nstate ; end

Serial Multiplier (Continued) // state transition process for controller or Z or pstate) begin case (pstate) T0: if (S) nstate = T1; else nstate = T0 ; T1: nstate = T2 ; T2: nstate = T3 ; T3: if (Z) nstate = T0; else nstate = T2 ; endcase end // register transfer operations clk) begin case (pstate) T0: B <= Bin ; T1: begin A <= 0 ; C <= 1 ; P <= 5 ; Q <= Qin ; end T2: begin P <= P - 1 ; if (Q[0]) {C,A} <= A + B ; end T3: begin C <= 0 ; A <= {C, A[4:1]} ; Q <= {A[0], Q{4:1]} ; end endcase end endmodule

Serial Multiplier (Testbench) // multiplier testbench module multiplier_tb; reg S, clk, clr ; reg [4:0] Bin, Qin ; wire C ; wire [4:0] A, Q ; wire [2:0] P ; // instantiate multiplier multiplier uut(S, clk, clr, Bin, Qin, C, A, Q, P); // generate test vectors initial begin #0 begin S = 0; clk = 0; clr = 0 ; end #5 begin S = 1; clr = 1; Bin = 5'b10111 ; Qin = 5'b10011 ; #15 begin S = 0 ; end

Serial Multiplier (Testbench, continued) // create dumpfile and generate clock initial begin $dumpfile("./multiplier.dmp") ; $dumpflush ; $dumpvars(2, multiplier_tb) ; repeat (26) #5 clk = ~clk ; end endmodule