| Extensions to the Forth Dictionary (additional Words)Code Extensions: 1. Floating Point. Many Forths expect the programmer to stick to integer arithmetic and use scaling factors to maintain precision, but the inclusion of floating point numbers makes the whole system more suitable to mathematical and scientific operations. Accordingly, floating point is now included in the main dictionary by using the facilities of the Floating Point Emulator. Single-precision values are used throughout (i.e. a 32-bit word contains the sign bit, mantissa and exponent) as otherwise an additional floating point stack would have been required plus some fairly fundamental changes to the basic arithmetical parts of the language. The precision and range are expected to be adequate for the likely applications to be chosen. There are numerous examples of the use of the floating point words (eg "FLOAT", "FIX", "FSIN" etc in the Downloads section) 2. Complex Numbers. A new data type for complex numbers has been defined using the words <BUILDS and DOES> (Note: <BUILDS is equivalent to CREATES for the later ANSI-Forth). Each element of the structure contains two words in order: the first being the real part and the second the imaginary part of the complex number. Mathematical manipulations such as multiplication, division and obtaining the complex conjugate have also been defined. Conversion to and from polar coordinates is included. Complex number operations are used in one of the projects discussed later - the Fast Fourier Transform (FFT). The complex numbers module is loaded separately from the core dictionary, as it is not required for every application. 3. Boolean Operators. The standard AND, NOT, OR etc apply to bit-wise checks between two parameters rather than 'Yes/No' logic i.e Boolean operators. The parameter in question is first made into a "1" or "0" and is then tested against a similarly defined value of a second parameter. The new words are lower-case equivalents of the upper-case bit-wise words in the main Forth dictionary (see the file "Boolean" in the Support directory of the downloaded language). 4. GPIO Control. In order to control the GPIO pins on the Pi, two methods were used: |