The well-known Hello World! C++ program prints its message to the console. In the digital world, the first program is the counter. The image presents the schematic of the Hello digital world! program as it appears in Novakod Studio. The complete source code follows. This code shows how easy it is to implement a simple counter in psC. This counter not only implements the basic functions, it also supports function priority, specified by the number in parenthesis.
The psC language includes all the usual high-level language types, from bit to long, including enums, fixed-point, floating-point and variable precision types.
FPGAs require optimized types. Variable precision signed and unsigned types up to 64 bits are supported.
The useful enum type is also supported. Here is a component using a few types with literal assignments:
The psC language expressions are identical to C++ expressions and include type cast, character functions, mathematical functions and, specific to psC, bit manipulation functions. The followingtables show the operators, expressions and assignments operators available.
More powerful than C++, the psC instructions if and switch are also expressions returning a value. This is quite useful for selective assignment. The example is an FSM (finite state machine) using only one switch instruction. As shown, if and switch can be embedded.