ASIC 120: Digital Systems and Standard-Cell ASIC Design Design Challenge 1: Jeff’s Solution November 2, 2005.

Slides:



Advertisements
Similar presentations
Table 7.1 Verilog Operators.
Advertisements

Ring Counter Discussion D5.3 Example 32. Ring Counter if rising_edge(CLK) then for i in 0 to 2 loop s(i)
Logic Design Fundamentals - 3 Discussion D3.2. Logic Design Fundamentals - 3 Basic Gates Basic Combinational Circuits Basic Sequential Circuits.
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
George Mason University ECE 448 – FPGA and ASIC Design with VHDL Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448.
4-bit Shift Register. 2-bit Register Serial-in-serial-out Shift Register.
George Mason University Modeling of Arithmetic Circuits ECE 545 Lecture 7.
ECE 332 Digital Electronics and Logic Design Lab Lab 5 VHDL Design Styles Testbenches.
ASIC 120: Digital Systems and Standard-Cell ASIC Design Tutorial 1: Introduction to Digital Circuits October 11, 2005.
Data Flow Modeling of Combinational Logic Simple Testbenches
ASIC 120: Digital Systems and Standard-Cell ASIC Design Tutorial 4: Digital Systems Concepts November 16, 2005.
Figure 5.1 Conversion from decimal to binary. Table 5.1 Numbers in different systems.
CprE / ComS 583 Reconfigurable Computing Prof. Joseph Zambreno Department of Electrical and Computer Engineering Iowa State University Lecture #17 – Introduction.
A VHDL Tutorial ENG2410. ENG241/VHDL Tutorial2 Goals Introduce the students to the following: –VHDL as Hardware description language. –How to describe.
Digital Kommunikationselektronik TNE027 Lecture 2 1 FA x n –1 c n c n1- y n1– s n1– FA x 1 c 2 y 1 s 1 c 1 x 0 y 0 s 0 c 0 MSB positionLSB position Ripple-Carry.
Chapter 10 State Machine Design. 2 State Machine Definitions State Machine: A synchronous sequential circuit consisting of a sequential logic section.
VHDL in 1h Martin Schöberl. AK: JVMHWVHDL2 VHDL /= C, Java,… Think in hardware All constructs run concurrent Different from software programming Forget.
ENG241 Digital Design Week #8 Registers and Counters.
Lecture #27 Page 1 ECE 4110– Sequential Logic Design Lecture #27 Agenda 1.Counters Announcements 1.HW #12 due.
1 ECE 545 – Introduction to VHDL Dataflow Modeling of Combinational Logic Simple Testbenches ECE 656. Lecture 2.
SEQUENTIAL LOGIC By Tom Fitch. Types of Circuits Combinational: Gates Combinational: Gates Sequential: Flip-Flops Sequential: Flip-Flops.
Reaction Timer Project
Hardware Description Languages Digital Logic Design Instructor: Kasım Sinan YILDIRIM.
VHDL Discussion Sequential Sytems. Memory Elements. Registers. Counters IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology.
 Seattle Pacific University EE Logic System DesignCounters-1 Shift Registers DQ clk DQ DQ ShiftIn Q3Q3 Q2Q2 DQ Q1Q1 Q0Q0 A shift register shifts.
1 Part III: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
George Mason University ECE 448 – FPGA and ASIC Design with VHDL VHDL Coding for Synthesis ECE 448 Lecture 12.
ASIC 120: Digital Systems and Standard-Cell ASIC Design Tutorial 3: Intermediate VHDL November 9, 2005.
VHDL Project I: Serial Adder Matthew Murach Slides Available at:
Number Representation and Arithmetic Circuits
1 ASIC 120: Digital Systems and Standard-Cell ASIC Design Tutorial 2: Introduction to VHDL February 1, 2006.
VHDL 7: use of signals v.5a1 VHDL 7 Use of signals In processes and concurrent statements.
ECE DIGITAL LOGIC LECTURE 20: REGISTERS AND COUNTERS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 11/19/2015.
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 8.
Lecture #27 Page 1 ECE 4110–5110 Digital System Design Lecture #27 Agenda 1.Counters Announcements 1.Finish reading Wakerly sections 8.1, 8.2, 8.4, 8.5.
ECE 448 – FPGA and ASIC Design with VHDL George Mason University ECE 448 Lab 1 Implementing Combinational Logic in VHDL.
Registers and Counters Discussion D8.1. Logic Design Fundamentals - 3 Registers Counters Shift Registers.
1 Computer Architecture & Assembly Language Spring 2009 Dr. Richard Spillman Lecture 11 – ALU Design.
Sequential statements (1) process
Combinational logic circuit
LAB #6 Sequential Logic Design (Flip Flops, Shift Registers)
Registers and Counters
Figure 7.1 Control of an alarm system
Part IV: VHDL CODING.
ECE 4110–5110 Digital System Design
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
In processes and concurrent statements
Sequential-Circuit Building Blocks
ASIC 120: Digital Systems and Standard-Cell ASIC Design
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
RTL Style در RTL مدار ترتيبي به دو بخش (تركيبي و عناصر حافظه) تقسيم مي شود. مي توان براي هر بخش يك پروسس نوشت يا براي هر دو فقط يك پروسس نوشت. مرتضي صاحب.
Sequential circuits and Digital System Reliability
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
VHDL (VHSIC Hardware Description Language)
CPE 528: Lecture #5 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
Behavioral Modeling of Sequential-Circuit Building Blocks
Sequntial-Circuit Building Blocks
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
Data Flow Description of Combinational-Circuit Building Blocks
ECE 448 Lab 1 Developing Effective Testbenches
Figure 8.1. The general form of a sequential circuit.
Data Flow Description of Combinational-Circuit Building Blocks
Design of Networks for Arithmetic Operation
CprE / ComS 583 Reconfigurable Computing
Sequntial-Circuit Building Blocks
4-Input Gates VHDL for Loops
Digital Logic with VHDL
(Sequential-Circuit Building Blocks)
(Simple Testbenches & Arithmetic Operations)
EEL4712 Digital Design (Midterm 1 Review).
Presentation transcript:

ASIC 120: Digital Systems and Standard-Cell ASIC Design Design Challenge 1: Jeff’s Solution November 2, 2005

Disclaimer These solutions may not be correct In fact, they haven’t even been tested –tested solutions to come later

Question 1 (a) Many cryptographic systems rely on modular arithmetic. An example would be “clock arithmetic”, where when you add 7 hours to 9 o’clock, it becomes 4 o’clock, not 16 o’clock. In this case the modulus would be 12. Design an 4-bit adder that adds modulo 16. That is, given inputs a and b, find a + b (mod 16).

Question 1 (a) two number adder: process begin wait until rising_edge(clk); c <= a + b; end process;

Question 1 (a) two number adder with mod 4: process begin wait until rising_edge(clk); c <= (a + b) mod 4; end process;

Question 1 (a) This is not easily synthesizable –good for high level design (behavioural design) –how is addition handled? –what does mod 4 really mean? How is it handled?

Question 1 (a) two number adder with extra stuff: library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; … signal a, b, c : std_logic_vector(3 downto 0); signal tmpc : unsigned(3 downto 0); … process begin wait until rising_edge(clk); tmpc <= unsigned(a) + unsigned(b); c <= std_logic_vector(tmpc); end process;

Question 1 (a) two number adder with selected extra stuff, mod 4: … signal a, b, c : std_logic_vector(3 downto 0); signal tmpa, tmpb, tmpc : unsigned(4 downto 0); … process begin wait until rising_edge(clk); tmpa <= ‘0’ & unsigned(a); tmpb <= ‘0’ & unsigned(b); tmpc <= tmpa + tmpb; c <= ‘0’ & std_logic_vector(tmpc(3 downto 0))(2 downto 0); end process;

Question 1 (a) Where was the “mod 4” –since 4 is a power of two, we could just “chop off” the higher order bits, which we did with the line c <= ‘0’ & std_logic_vector(tmpc(3 downto 0))(2 downto 0); Always look for powers of 2 when –multiplying –dividing –modding

Question 1 (b) Many cryptographic systems rely on modular arithmetic. An example would be “clock arithmetic”, where when you add 7 hours to 9 o’clock, it becomes 4 o’clock, not 16 o’clock. In this case the modulus would be 12. Design a 4-bit adder that adds modulo 23. Public key applications such as Diffie-Hellman key exchange use prime numbers for their modulus for their properties.

Question 1 (b) We can’t use the same trick as last time –23 is not a power of 2 How do we multiply, divide, or add by a power that is not 2?

Question 1 (b) One way: use repeated addition or subtraction Consider the following setup: process begin wait until rising_edge(clk); in_num_a <= ‘0’ & unsigned(in_val_a); in_num_b <= ‘0’ & unsigned(in_val_a); tmp_num_c <= in_num_a + in_num_b; [ mod stuff here ] end process;

Question 1 (b) Using the previous setup: … while (tmp_num_c > 22) loop wait until rising_edge(clk); tmp_num_c <= tmp_num_c – 23; end loop; out_val_c <= std_logic_vector(tmp_num_c(3 downto 0)); …

Question 1 (b) What would the signal declarations look like? Possibly: signalin_val_a, in_val_b, out_val_c : std_logic_vector(3 downto 0); signalin_num_a, in_num_b, tmp_num_c : unsigned(4 downto 0);

Question 1 (b) Possible enhancement: –add control signals process begin while (start_mod = ‘0’) loop done_mod <= ‘0’; wait until rising_edge(clk); end loop; [ do add and mod ] done_mod <= ‘1’; wait until rising_edge(clk); end process;

Question 2 Linear Feedback Shift Registers (LFSRs) are used in many cryptographic applications. At its core an LFSR is just a series of D Flip Flops, and a feedback that combines certain elements with XORs. (See diagram below.) All the Ds in this diagram are LFSRs, and the bottom is an XOR. Implement this LFSR.

Question 2 Let’s break the question down First, consider four chained D Flip Flops (DFFs) labelled A, B, C, D: signal a, b, c, d : std_logic; … process begin wait until rising_edge(clk); a <= ff_input; b <= a; c <= b; d <= c; end process;

Question 2 Consider four chained (DFFs) with feedback from D to A: process begin wait until rising_edge(clk); a <= d; b <= a; c <= b; d <= c; end process;

Question 2 Consider four chained (DFFs) with feedback from D to A with an XOR gate: process begin wait until rising_edge(clk); a <= a xor d; b <= a; c <= b; d <= c; end process;

Question 2 But what are the initial values? –we could preload some process begin a <= ‘0’; b <= ‘0’; c <= ‘0’; d <= ‘0’; loop wait until rising_edge(clk); a <= a xor d; b <= a; c <= b; d <= c; end loop; end process;

Question 2 Or we could set some at will –note the included reset option process begin wait until rising_edge(clk); if (reset = ‘1’) then a <= ‘0’; b <= ‘0’; c <= ‘0’; d <= ‘0’; elsif (load = ‘1’) then a <= ld_a; b <= ld_b; c <= ld_c; d <= ld_d; else a <= a xor d; b <= a; c <= b; d <= c; end if; end process;

UW ASIC Design Team reference material –Accolade VHDL reference (excellent!): many of today’s examples came from here –Bryce Leung’s tutorials (UW ASIC website) –Mike Goldsmith’s tutorials (UW ASIC website) –your course notes my contact info: Jeff Wentworth,