Docsity

Basic Building Blocks (Lecture 5), Slides of Digital Systems Design

Partial preview of the text

Download Basic Building Blocks (Lecture 5) and more Slides Digital Systems Design in PDF only on Docsity!

Basic Building Blocks

Lecture 5

Dr. Shoab A. Khan

Embedded Units in FPGAs

New Trends in FPGAs’ Architecture

Digital Design of Signal Processing Systems, John Wiley & Sons by Dr. Shoab A. Khan

Embedded Arithmetic Units in FPGAs

4

Digital Design of Signal Processing Systems, John Wiley & Sons by Dr. Shoab A. Khan 5

(a) DSP48 in VirtexTM-4 FPGA (Derived from Xilinx documentation)

A 18 18

BCOUT 18

B

X

C^48

48 48 48

CIN 72

(^3838)

4838 Y (^48) X

P

48 +

48

SUBSTRACT

PCOUT

48 Wire shift Right by 17 Bits

A 18 B^18

48 48

BCOUNT

(^1818)

18 18 48 48 48

CIN 72

(^3838)

4838 Y (^48) X

P

48 +

48

SUBSTRACT

PCOUT

48

18

18 BCIN (^) Wire shift Right by 17 Bits

BCIN PCIN

48

PCIN

48

x

x

X

8x8 multiplier and 16-bit adder in Quick Logic FPGA

INSTRUCTION FIFOs RAM

ADD REGISTER MULTIPLY

BBUS

ABUS

RBUS

CBUS

16 16

8 8

(^1616)

17

3

18x18 multiplier in Virtex-II, Virtex-II pro and

SpartanTM-3 FPGA

18 x18 bit multiplier

36

18

18

A

B

Embedded Multipliers

 Automatic instantiation

w [ n ] a 1 w [ n 1 ] a 2 w [ n 2 ] x [ n ]

y [ n ] b 0 w [ n ] b 1 w [ n 1 ] b 2 w [ n 2 ]

+

+

x

x

x

+

x +

x

x[n] w[n]

w[n]

a 1

a 2

b 0

b 1

b 2

y[n] 16 32

32

32

16

16

16

16

32

32

32

32

w[n-1]

w[n-2]

Q 16

Block diagram of a 2nd^ Order IIR filter in Direct Form II Realization

(a)

Synthesis of the design on Spartan™-3 FPGA, the multiplication and addition operations are mapped on DSP48 Multiply Accumulate (MAC) embedded blocks

13

Selected Device : 3s400pq208- 5

Minimum period: 10.917ns (Maximum Frequency: 91.597MHz)

Number of Slices: 58 out of 3584 1%

Number of Slice Flip Flops: 32 out of 7168 0%

Number of 4 input LUTs: 109 out of 7168 1%

Number of IOs: 50

Number of bonded IOBs: 50 out of 141 35%

Number of MULT18X18s: 5 out of 16 31%

Number of GCLKs: 1 out of 8 12%

(c)

RTL schematic generated by Xilinx ISE for Virtex™ 4 target device. The multiplication and addition operations are mapped on DSP multiply accumulate (MAC) embeded blocks

14

(d)

Digital Design of Signal Processing Systems, John Wiley & Sons by Dr. Shoab A. Khan 16

// w[n] in Q 2. 30 format with one redundant sign bit assign wfn = wn_ 1 *a 1 +wn_ 2 *a 2 ;

/* through away redundant sign bit and keeping 16 MSB and adding x[n] to get w[n] in Q 1. 15 format */ assign wn = wfn[ 30 : 15 ]+xn;

// computing y[n] in Q 2. 30 format with one redundant sign bit assign yn = b 0 *wn + b 1 *wn_ 1 + b 2 *wn_ 2 ;

always @(posedge clk or posedge rst) begin if(rst) begin wn_ 1 <= 0 ; wn_ 2 <= 0 ; end else begin wn_ 1 <= wn; wn_ 2 <= wn_ 1 ; end End

Endmodule

An 8-tap Direct Form (DF)-I FIR filter

17

x x +

x +

**x

  • +**

x +

x +

x +

y[n]

16 16 x[0] x[2] x[3] x[4] x[5] x[6]

40 16

data_out

clk

b 0

x[1]

b 1 b 3 b 4 b 5 b 6 b 7

data_in

b 2

x[7]

Q (^) 16

x

Contd…

19

// Constants, filter is designed using Matlab FDATool, all coeffs are in Q 1. 15 format parameter signed [ 15 : 0 ] b 0 = 16 'b 1101110110111011 ; parameter signed [ 15 : 0 ] b 1 = 16 'b 1110101010001110 ; parameter signed [ 15 : 0 ] b 2 = 16 'b 0011001111011011 ; parameter signed [ 15 : 0 ] b 3 = 16 'b 0110100000001000 ; parameter signed [ 15 : 0 ] b 4 = 16 'b 0110100000001000 ; parameter signed [ 15 : 0 ] b 5 = 16 'b 0011001111011011 ; parameter signed [ 15 : 0 ] b 6 = 16 'b 1110101010001110 ; parameter signed [ 15 : 0 ] b 7 = 16 'b 1101110110111011 ;

reg signed [ 15 : 0 ] xn [ 0 : 7 ]; // input sample delay line wire signed [ 39 : 0 ] yn; // Q 8. 32

// Block Statements always @(posedge clk) Begin xn[ 0 ] <= data_in; xn[ 1 ] <= xn[ 0 ]; xn[ 2 ] <= xn[ 1 ]; xn[ 3 ] <= xn[ 2 ]; xn[ 4 ] <= xn[ 3 ];

Contd…

20

xn[ 5 ] <= xn[ 4 ]; xn[ 6 ] <= xn[ 5 ]; xn[ 7 ] <= xn[ 6 ]; data_out <= yn[ 30 : 15 ]; // bring the output back in Q 1. 15 format end

assign yn = xn[ 0 ] * b 0 + xn[ 1 ] * b 1 + xn[ 2 ] * b 2 + xn[ 3 ] * b 3 + xn[ 4 ] * b 4 + xn[ 5 ] * b 5 + xn[ 6 ] * b 6 + xn[ 7 ] * b 7 ;

endmodule // fir_filter