Expand description
This is an implementation of unsigned types of various bit widths which accompanies the signed one’s-complement types. Since these types are unsigned, there is no sign bit and they aren’t really one’s-complement types. But the interface to these is mostly similar to that of the signed (real one’s-complement) types.
Macros§
- from_
native_ 🔒type_ to_ self - This macro implements conversions from native types to Unsigned*Bit
which are always possible (e.g.
From<u8> for Unsigned9Bit
). - from_
self_ 🔒to_ native_ type - This macro implements conversions from Unsigned*Bit to native
types which are always possible (e.g.
From<Unsigned9Bit> for i16
). - try_
from_ 🔒native_ type_ to_ self - This macro implements a conversions from native types to
Unsigned*Bit where the conversion may not always fit. For example
TryFrom<u64> for Unsigned36Bit
. - try_
from_ 🔒self_ to_ native_ type - This macro implements conversions from Unsigned*Bit to native
types where the conversion may not always fit. For example
TryFrom<Unsigned18Bit> for u8
. - unsigned_
ones_ 🔒complement_ impl - This macro implements the base functionality of the unsigned
types. The
SelfT
argument is the name of the (unsigned in this case) type we are defining.BITS
is the bit width of the type we are defining.InnerT
is the name of the native type which will store those bits.SignedPeerT
is the name of the equivalent signed type having the same width (e.g. forUnsigned18Bit
this should beSigned18Bit
).
Structs§
- Unsigned5
Bit Unsigned5Bit
is used as a system configuration value; that is, an index into F-memory.- Unsigned6
Bit Unsigned6Bit
is used as an X-register address. That is, thej
inXj
.- Unsigned9
Bit Unsigned9Bit
is the value of a “quarter” of the 36-bit TX-2 machine word. A number of instructions - and in particular the Exchange Unit - work on the quarters of a word.- Unsigned12
Bit Unsigned12Bit
is used as the mode of a connected I/O device.- Unsigned18
Bit Unsigned18Bit
is the value of a “half” of the 36-bit TX-2 machine word. We use this type to hold STUV-memory addresses, among other things. Physical memory addresses though are only 17 bits wide. The remaining bit can be used to “mark” an address either for tracing (when it’s an instruction address) or for deferred addressing (when it’s an operand address).- Unsigned36
Bit Unsigned36Bit
is the basic machine word of the TX-2. This is the width of the registers in the Arithmetic Unit, and it is the unit on which the Exchange Unit operates when performing memory fetches or stores. This is also the width of all instructions.