Floating-point arithmetic is commonly used in algorithms where the values vary over a relatively large dynamic range. The difference between floating-point and fixed-point arithmetic and is that the later one has a radix point with a predetermined location to divide the fractional part and the integer part. On the other hand, the floating-point representation uses three fields to represent real values: the sign, exponent, and fraction.
module module_draw (input a,b,c,
input [1:0] s,
output reg o);
always @* begin
if (s == 2'b00) o = a;
else if (s == 2'b01) o = b;
else if (s == 2'b10) o = c;
Case statement is usually used to model read-only memory (ROM). For some compiler or certain device family, either the address or the output has to be registered for ROM code to be inferred. block RAM resources could be used to implemented ROMs with synchronous outputs or address inputs.
Blocking assignments/statements are used to create combinatorial logic which are written as “=” operator. Non-blocking assignments/statements are used to create sequential logic, which are written as “<=” operator. The registers/wire on the left side of blocking assignments are updated immediately while the registers/wire on the left side of non-blocking assignments are updated in the next clock cycle.