vault backup: 2025-02-03 11:14:08

This commit is contained in:
arc 2025-02-03 11:14:08 -07:00
parent ba1c7d92b6
commit 116ab612fc

View File

@ -56,5 +56,25 @@ A `time` variable is unsigned, 64 bits wide, and can be used to store time durat
## Real
The `real` type denotes a floating point value.
## Strings
Strings are stored in a vector of `reg`s. The width of the `reg` *must* be large enough to hold the string.
Each character in a string represents a one byte ASCII value. If the size of the variable is smaller than the string, the string is truncated.
# Scalar and Vector Types
By default, declarations of a net or `reg` value is 1 bit wide, referred to as a *scalar* value (only a single value).
```verilog
// Scalar declaration
wire foo;
// Vector declaration, with 8 bits.
wire [7:0] bar;
```
Individual bits in a vector can be accessed using array operators, eg `[i]`.
```verilog
reg [7:0] foo;
// Write to bit 0
foo [0] = 1;
```