EECS150 - Digital Design Lecture 21 - Design Blocks

Similar documents
Linear Feedback Shift Registers (LFSRs) 4-bit LFSR

EECS150 - Digital Design Lecture 26 Error Correction Codes, Linear Feedback Shift Registers (LFSRs)

EECS150 - Digital Design Lecture 23 - FFs revisited, FIFOs, ECCs, LSFRs. Cross-coupled NOR gates

EECS Components and Design Techniques for Digital Systems. Lec 26 CRCs, LFSRs (and a little power)

EECS150 - Digital Design Lecture 24 - Arithmetic Blocks, Part 2 + Shifters

EECS150 - Digital Design Lecture 25 Shifters and Counters. Recap

Outline. EECS Components and Design Techniques for Digital Systems. Lec 18 Error Coding. In the real world. Our beautiful digital world.

EECS150 - Digital Design Lecture 27 - misc2

Outline. EECS150 - Digital Design Lecture 26 Error Correction Codes, Linear Feedback Shift Registers (LFSRs) Simple Error Detection Coding

EECS150 - Digital Design Lecture 26 - Faults and Error Correction. Types of Faults in Digital Designs

EECS150 - Digital Design Lecture 26 Faults and Error Correction. Recap

Review. EECS Components and Design Techniques for Digital Systems. Lec 26 CRCs, LFSRs (and a little power)

EECS150 - Digital Design Lecture 11 - Shifters & Counters. Register Summary

EECS150 - Digital Design Lecture 23 - FSMs & Counters

Design of Sequential Circuits

EECS150 - Digital Design Lecture 22 - Arithmetic Blocks, Part 1

How does the computer generate observations from various distributions specified after input analysis?

EECS150 - Digital Design Lecture 18 - Counters

EECS150 - Digital Design Lecture 18 - Counters

Error Detection & Correction

EECS150 - Digital Design Lecture 17 - Sequential Circuits 3 (Counters)

PSEUDORANDOM BINARY SEQUENCES GENERATOR

Information redundancy

Logic and Computer Design Fundamentals. Chapter 8 Sequencing and Control

EECS150 - Digital Design Lecture 10 - Combinational Logic Circuits Part 1

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

Design at the Register Transfer Level

Parity Checker Example. EECS150 - Digital Design Lecture 9 - Finite State Machines 1. Formal Design Process. Formal Design Process

CS61C : Machine Structures

ECE 4450:427/527 - Computer Networks Spring 2017

COE 202: Digital Logic Design Sequential Circuits Part 4. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

FPGA BASED DESIGN OF PARALLEL CRC GENERATION FOR HIGH SPEED APPLICATION

EECS Components and Design Techniques for Digital Systems. FSMs 9/11/2007

GF(2 m ) arithmetic: summary

Counters. We ll look at different kinds of counters and discuss how to build them

Fundamentals of Digital Design

ECE 341. Lecture # 3

Error Correction and Trellis Coding

CSCE 564, Fall 2001 Notes 6 Page 1 13 Random Numbers The great metaphysical truth in the generation of random numbers is this: If you want a function

COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES Concordia University

Maximum Length Linear Feedback Shift Registers

Cryptography Lecture 3. Pseudorandom generators LFSRs

Galois Field Algebra and RAID6. By David Jacob

CS61C : Machine Structures

Boolean Algebra and Digital Logic 2009, University of Colombo School of Computing

L9: Galois Fields. Reading material

EECS 270 Midterm Exam 2 Fall 2009

B. Cyclic Codes. Primitive polynomials are the generator polynomials of cyclic codes.

For smaller NRE cost For faster time to market For smaller high-volume manufacturing cost For higher performance

EECS150 - Digital Design Lecture 16 Counters. Announcements

A COMBINED 16-BIT BINARY AND DUAL GALOIS FIELD MULTIPLIER. Jesus Garcia and Michael J. Schulte

Chapter 6. BCH Codes

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

Cyclic Codes. Saravanan Vijayakumaran August 26, Department of Electrical Engineering Indian Institute of Technology Bombay

FPGA accelerated multipliers over binary composite fields constructed via low hamming weight irreducible polynomials

Numbers and Arithmetic

Design and Implementation of High Speed CRC Generators

Review: Designing with FSM. EECS Components and Design Techniques for Digital Systems. Lec 09 Counters Outline.

Time Allowed 3:00 hrs. April, pages

Logic BIST. Sungho Kang Yonsei University

Fully-parallel linear error block coding and decoding a Boolean approach

Review: Designing with FSM. EECS Components and Design Techniques for Digital Systems. Lec09 Counters Outline.

CMPEN 411 VLSI Digital Circuits Spring Lecture 19: Adder Design

Digital Logic Design - Chapter 4

CprE 281: Digital Logic

CSE140: Components and Design Techniques for Digital Systems. Midterm Information. Instructor: Mohsen Imani. Sources: TSR, Katz, Boriello & Vahid

Objective: To become acquainted with the basic concepts of cyclic codes and some aspects of encoder implementations for them.

Lecture 8: Sequential Multipliers

Logic Design II (17.342) Spring Lecture Outline

Subquadratic space complexity multiplier for a class of binary fields using Toeplitz matrix approach

Fields in Cryptography. Çetin Kaya Koç Winter / 30

ECE 545 Digital System Design with VHDL Lecture 1A. Digital Logic Refresher Part A Combinational Logic Building Blocks

A field F is a set of numbers that includes the two numbers 0 and 1 and satisfies the properties:

ECE/Comp Sci 352 Digital Systems Fundamentals. Charles R. Kime Section 2 Fall Logic and Computer Design Fundamentals

Fault Tolerance & Reliability CDA Chapter 2 Cyclic Polynomial Codes

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

UNIT 8A Computer Circuitry: Layers of Abstraction. Boolean Logic & Truth Tables

Tate Bilinear Pairing Core Specification. Author: Homer Hsing

Some math for embedded algorithms

CMP 334: Seventh Class

Lecture 14. Outline. 1. Finish Polynomials and Secrets. 2. Finite Fields: Abstract Algebra 3. Erasure Coding

1 Introduction. 2 Calculation of the output signal

CS1800 Discrete Structures Final Version A

Department of Electrical and Computer Engineering University of Wisconsin Madison. Fall Final Examination

Chapter 4 Mathematics of Cryptography

Digital Logic. CS211 Computer Architecture. l Topics. l Transistors (Design & Types) l Logic Gates. l Combinational Circuits.

Dual-Field Arithmetic Unit for GF(p) and GF(2 m ) *

ECE 545 Digital System Design with VHDL Lecture 1. Digital Logic Refresher Part A Combinational Logic Building Blocks

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

DE58/DC58 LOGIC DESIGN DEC 2014

ELCT201: DIGITAL LOGIC DESIGN

Finite Fields. SOLUTIONS Network Coding - Prof. Frank H.P. Fitzek

Latches. October 13, 2003 Latches 1

Cyclic codes: overview

Digital Electronics. Delay Max. FF Rate Power/Gate High Low (ns) (MHz) (mw) (V) (V) Standard TTL (7400)

Error Correction Review

BOOLEAN ALGEBRA. Introduction. 1854: Logical algebra was published by George Boole known today as Boolean Algebra

Overview. Arithmetic circuits. Binary half adder. Binary full adder. Last lecture PLDs ROMs Tristates Design examples

AN IMPROVED LOW LATENCY SYSTOLIC STRUCTURED GALOIS FIELD MULTIPLIER

Review Problem 1. should be on. door state, false if light should be on when a door is open. v Describe when the dome/interior light of the car

Transcription:

EECS150 - Digital Design Lecture 21 - Design Blocks April 3, 2012 John Wawrzynek Spring 2012 EECS150 - Lec21-db3 Page 1

Fixed Shifters / Rotators fixed shifters hardwire the shift amount into the circuit. Ex: verilog: X >> 2 (right shift X by 2 places) Fixed shift/rotator is nothing but wires! So what? Logical Shift Rotate Arithmetic Shift Spring 2012 EECS150 - Lec21-db3 Page 2

Variable Shifters / Rotators Example: X >> S, where S is unknown when we synthesize the circuit. Uses: shift instruction in processors (ARM includes a shift on every instruction), floating-point arithmetic, division/multiplication by powers of 2, etc. One way to build this is a simple shift-register: a) Load word, b) shift enable for S cycles, c) read word. Worst case delay O(N), not good for processor design. Can we do it in O(logN) time and fit it in one cycle? Spring 2012 EECS150 - Lec21-db3 Page 3

Log Shifter / Rotator Log(N) stages, each shifts (or not) by a power of 2 places, S=[s 2 ;s 1 ;s 0 ]: Shift by N/2 Shift by 2 Shift by 1 Spring 2012 EECS150 - Lec21-db3 Page 4

LUT Mapping of Log shifter Efficient with 2to1 multiplexors, for instance, 3LUTs. Virtex6 has 6LUTs. Naturally makes 4to1 muxes: Reorganize shifter to use 4to1 muxes. Final stage uses F7 mux Spring 2012 EECS150 - Lec21-db3 Page 5

Improved Shifter / Rotator How about this approach? Could it lead to even less delay? What is the delay of these big muxes? Look a transistor-level implementation? Spring 2012 EECS150 - Lec21-db3 Page 6

Barrel Shifter Cost/delay? (don t forget the decoder) Spring 2012 EECS150 - Lec21-db3 Page 7

Connection Matrix Generally useful structure: N 2 control points. What other interesting functions can it do? Spring 2012 EECS150 - Lec21-db3 Page 8

Cross-bar Switch Nlog(N) control signals. Supports all interesting permutations All one-to-one and one-to-many connections. Commonly used in communication hardware (switches, routers). Spring 2012 EECS150 - Lec21-db3 Page 9

Linear Feedback Shift Registers (LFSRs) These are n-bit counters exhibiting pseudo-random behavior. Built from simple shift-registers with a small number of xor gates. Used for: random number generation counters error checking and correction Advantages: very little hardware high speed operation Example 4-bit LFSR: Spring 2012 EECS150 Lec21-db3 Page 10

4-bit LFSR Circuit counts through 2 4-1 different non-zero bit patterns. Leftmost bit decides whether the 10011 xor pattern is used to compute the next value or if the register just shifts left. Can build a similar circuit with any number of FFs, may need more xor gates. In general, with n flip-flops, 2 n -1 different non-zero bit patterns. (Intuitively, this is a counter that wraps around many times and in a strange way.) Spring 2012 EECS150 Lec21-db3 Page 11

Applications of LFSRs Performance: In general, xors are only ever 2- input and never connect in series. Therefore the minimum clock period for these circuits is: T > T 2-input-xor + clock overhead Very little latency, and independent of n! This can be used as a fast counter, if the particular sequence of count values is not important. Example: micro-code micro-pc Can be used as a random number generator. Sequence is a pseudorandom sequence: numbers appear in a random sequence repeats every 2 n -1 patterns Random numbers useful in: computer graphics cryptography automatic testing Used for error detection and correction CRC (cyclic redundancy codes) ethernet uses them Spring 2012 EECS150 Lec21-db3 Page 12

Galois Fields - the theory behind LFSRs LFSR circuits performs multiplication on a field. A field is defined as a set with the following: two operations defined on it: addition and multiplication closed under these operations associative and distributive laws hold additive and multiplicative identity elements additive inverse for every element multiplicative inverse for every non-zero element Example fields: set of rational numbers set of real numbers set of integers is not a field (why?) Finite fields are called Galois fields. Example: Binary numbers 0,1 with XOR as addition and AND as multiplication. Called GF(2). Spring 2012 EECS150 Lec21-db3 Page 13

Galois Fields - The theory behind LFSRs Consider polynomials whose coefficients come from GF(2). Each term of the form x n is either present or absent. Examples: 0, 1, x, x 2, and x 7 + x 6 + 1 = 1 x 7 + 1 x 6 + 0 x 5 + 0 x 4 + 0 x 3 + 0 x 2 + 0 x 1 + 1 x 0 With addition and multiplication these form a field: Add : XOR each element individually with no carry: x 4 + x 3 + + x + 1 + x 4 + + x 2 + x x 3 + x 2 + 1 Multiply : multiplying by x n is like shifting to the left. x 2 + x + 1 x + 1 x 2 + x + 1 x 3 + x 2 + x x 3 + 1 Spring 2012 EECS150 Lec21-db3 Page 14

Galois Fields - The theory behind LFSRs These polynomials form a Galois (finite) field if we take the results of this multiplication modulo a prime polynomial p(x). A prime polynomial is one that cannot be written as the product of two non-trivial polynomials q(x)r(x) Perform modulo operation by subtracting a (polynomial) multiple of p(x) from the result. If the multiple is 1, this corresponds to XOR-ing the result with p(x). For any degree, there exists at least one prime polynomial. With it we can form GF(2 n ) Additionally, Every Galois field has a primitive element, α, such that all non-zero elements of the field can be expressed as a power of α. By raising α to powers (modulo p(x)), all non-zero field elements can be formed. Certain choices of p(x) make the simple polynomial x the primitive element. These polynomials are called primitive, and one exists for every degree. For example, x 4 + x + 1 is primitive. So α = x is a primitive element and successive powers of α will generate all non-zero elements of GF(16). Example on next slide. Spring 2012 EECS150 Lec21-db3 Page 15

Galois Fields - The theory behind LFSRs α 0 = 1 α 1 = α 2 = x 2 α 3 = x 3 x α 4 = x + 1 α 5 = α 6 = x 3 + x 2 x 2 + x α 7 = x 3 + x + 1 α 8 = x 2 + 1 α 9 = x 3 + x α 10 = x 2 + x + 1 α 11 = x 3 + x 2 + x α 12 = x 3 + x 2 + x + 1 α 13 = x 3 + x 2 + 1 α 14 = x 3 + 1 α 15 = 1 Note this pattern of coefficients matches the bits from our 4-bit LFSR example. α 4 = x 4 mod x 4 + x + 1 = x 4 xor x 4 + x + 1 = x + 1 In general finding primitive polynomials is difficult. Most people just look them up in a table, such as: Spring 2012 EECS150 Lec21-db3 Page 16

x 2 + x +1 x 3 + x +1 x 4 + x +1 x 5 + x 2 +1 x 6 + x +1 x 7 + x 3 +1 x 8 + x 4 + x 3 + x 2 +1 x 9 + x 4 +1 x 10 + x 3 +1 x 11 + x 2 +1 Primitive Polynomials x 12 + x 6 + x 4 + x +1 x 13 + x 4 + x 3 + x +1 x 14 + x 10 + x 6 + x +1 x 15 + x +1 x 16 + x 12 + x 3 + x +1 x 17 + x 3 + 1 x 18 + x 7 + 1 x 19 + x 5 + x 2 + x+ 1 x 20 + x 3 + 1 x 21 + x 2 + 1 Galois Field Hardware Multiplication by x shift left Taking the result mod p(x) Obtaining all 2 n -1 non-zero elements by evaluating x k for k = 1,, 2 n -1 x 22 + x +1 x 23 + x 5 +1 x 24 + x 7 + x 2 + x +1 x 25 + x 3 +1 x 26 + x 6 + x 2 + x +1 x 27 + x 5 + x 2 + x +1 x 28 + x 3 + 1 x 29 + x +1 x 30 + x 6 + x 4 + x +1 x 31 + x 3 + 1 x 32 + x 7 + x 6 + x 2 +1 XOR-ing with the coefficients of p(x) when the most significant coefficient is 1. Shifting and XOR-ing 2 n -1 times. Spring 2012 EECS150 Lec21-db3 Page 17

Building an LFSR from a Primitive Polynomial For k-bit LFSR number the flip-flops with FF1 on the right. The feedback path comes from the Q output of the leftmost FF. Find the primitive polynomial of the form x k + + 1. The x 0 = 1 term corresponds to connecting the feedback directly to the D input of FF 1. Each term of the form x n corresponds to connecting an xor between FF n and n +1. 4-bit example, uses x 4 + x + 1 x 4 FF4 s Q output x xor between FF1 and FF2 1 FF1 s D input To build an 8-bit LFSR, use the primitive polynomial x 8 + x 4 + x 3 + x 2 + 1 and connect xors between FF2 and FF3, FF3 and FF4, and FF4 and FF5. Spring 2012 EECS150 Lec21-db3 Page 18

Error Correction with LFSRs Spring 2012 EECS150 Lec21-db3 Page 19

Error Correction with LFSRs XOR Q4 with incoming bit sequence. Now values of shift-register don t follow a fixed pattern. Dependent on input sequence. Look at the value of the register after 15 cycles: 1010 Note the length of the input sequence is 2 4-1 = 15 (same as the number of different nonzero patters for the original LFSR) Binary message occupies only 11 bits, the remaining 4 bits are 0000. They would be replaced by the final result of our LFSR: 1010 If we run the sequence back through the LFSR with the replaced bits, we would get 0000 for the final result. 4 parity bits neutralize the sequence with respect to the LFSR. 1 1 0 0 1 0 0 0 1 1 1 0 0 0 0 1 0 1 0 1 1 0 0 1 0 0 0 1 1 1 1 0 1 0 0 0 0 0 If parity bits not all zero, an error occurred in transmission. If number of parity bits = log total number of bits, then single bit errors can be corrected. Using more parity bits allows more errors to be detected. Ethernet uses 32 parity bits per frame (packet) with 16-bit LFSR. Spring 2012 EECS150 Lec21-db3 Page 20