Altera Designing With Low-Level Primitives User Manual

Page 21

Advertising
background image

Altera Corporation

1–15

April 2007

Designing with Low-Level Primitives User Guide

Low-Level Primitive Design

Example 1–10

uses the LUT primitive to create LUTs that implement a

4-input

AND and a 4-input OR function.

Example 1–10. Using the LUT Primitive
module luts (

input [3:0] in1, in2,

output out1, out2

);

lut_sub inst1 (in1, out1);

defparam inst1.mask = 16'H8000; // AND function

lut_sub inst2 (in2, out2);

defparam inst2.mask = 16'HFFFE; // OR function

endmodule

Advertising