ece124: add gray code

This commit is contained in:
eggy 2023-01-23 20:29:45 -05:00
parent 349513f5fd
commit 1d386d4dcd

View File

@ -255,6 +255,17 @@ A **field-programmable gate array** (FPGA) is hardware that does not come with f
- logic blocks (that are user-programmed to behave like gates) - logic blocks (that are user-programmed to behave like gates)
- lookup tables (LUTs) inside the logic gates, which are a small amount of memory - lookup tables (LUTs) inside the logic gates, which are a small amount of memory
## Gray code
The Gray code is a binary number system that has any two adjacent numbers differing by **exactly one bit**. It is used to optimise the number of gates in a function.
The 1-bit Gray code is $0, 1$. To convert an $n$-bit Gray code to an $n+1$-bit Gray code:
- Mirror the code: $0,1,1,0$
- Add $0$ to the original and $1$ to the new ones: $00, 01, 11, 10$
Sorting truth table inputs in the order of the Gray code makes optimisation easier to do.
## VHDL ## VHDL
VHDL is a hardware schematic language. VHDL is a hardware schematic language.