1 Answers
In computer science, a lookup table is an array that replaces runtime computation with a simpler array indexing operation. The process is termed as "direct addressing" and LUTs differ from hash tables in a way that, to retrieve a value v {\displaystyle v} with key k {\displaystyle k} , a hash table would store the value v {\displaystyle v} in the slot h {\displaystyle h} where h {\displaystyle h} is a hash function i.e. k {\displaystyle k} is used to compute the slot, while in the case of LUT, the value v {\displaystyle v} is stored in slot k {\displaystyle k} , thus directly addressable. The savings in processing time can be significant, because retrieving a value from memory is often faster than carrying out an "expensive" computation or input/output operation. The tables may be precalculated and stored in static program storage, calculated as part of a program's initialization phase , or even stored in hardware in application-specific platforms. Lookup tables are also used extensively to validate input values by matching against a list of valid items in an array and, in some programming languages, may include pointer functions to process the matching input. FPGAs also make extensive use of reconfigurable, hardware-implemented, lookup tables to provide programmable hardware functionality.