Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

LUT - 5 Input lookup table

An LUT block produces an output that is determined by a user-programmable 5-input logic function, set with the FUNC register.

Fields

NameTypeDescription
INPAbit_muxInput A
INPBbit_muxInput B
INPCbit_muxInput C
INPDbit_muxInput D
INPEbit_muxInput E
TYPEAparam enumSource of the value of A for calculation
TYPEBparam enumSource of the value of B for calculation
TYPECparam enumSource of the value of C for calculation
TYPEDparam enumSource of the value of D for calculation
TYPEEparam enumSource of the value of E for calculation
FUNCparam lutInput func
OUTbit_outLookup table output

Testing Function Output

This set of tests sets the function value and checks whether the output is as expected

The value of FUNC is a 32-bit unsigned int representing the truth table output of the 5 inputs. The mapping of the string to an integer is done by the PandABlocks TCP server.

A&B&C&D&E (FUNC= 0x80000000). Setting all inputs to 1 results in an output of 1, and changing any inputs produces an output of 0

A&B&C&D&E Output

~A&~B&~C&~D&~E (FUNC= 0x00000001). Setting all inputs to 0 results in an output of 1, and changing any inputs produces an output of 0

~A&~B&~C&~D&~E Output

A (FUNC= 0xffff0000). The output should only be 1 if A is 1 irrespective of any other input.

A output

A&B|C&~D (FUNC= 0xff303030)

A&B|C&~D output

Changing the function in a test

If a function is changed, the output will take effect on the next clock tick

Changing function from A&B&C&D&E to ~A&~B&~C&~D&~E

Edge triggered inputs

We can also use the LUT to convert edges into levels by changing A..E to be one clock tick wide pulses based on edges rather than the current level of INPA..INPE.

If we wanted to produce a pulse only if INPA had a rising edge on the same clock tick as INPB had a falling edge we could set FUNC=0xff000000 (A&B) and A=1 (rising edge of INPA) and B=2 (falling edge of INPB):

Rising A & Falling B

We could also use this for generating pulses on every transition of A:

Either edge A