pub struct Memory {
    pub inp: Signal16,
    pub load: Signal,
    pub address: Signal15,
    pub out: Signal16,
    pub selected: Signal16,
    pub ram: Ram16k,
    pub screen: Screen,
    pub keyboard: Keyboard,
}
Expand description

Fast package of three 16-bit chip parts: Ram16k, Screen, and Keyboard

Fields

inp: Signal16load: Signaladdress: Signal15out: Signal16selected: Signal16ram: Ram16kscreen: Screenkeyboard: Keyboard

Implementations

Carries out the simulation, taking as input:

  • inp: data input
  • load: whether to write inp into the RAM
  • address: which register to select
    • [0, 16383] results in accessing Ram16k
    • [16384, 24575] results in accessing the Screen
    • 24576 results in accessing the Keyboard

It returns the value stored at address. Furthermore, when loadisHI, inpis written at locationaddress`, and the loaded value will be emitted from the next time step onward.

Trait Implementations

Returns the “default value” for a type. Read more
Carries out the tick-phase of a clock cycle: LOW
Evaluates the logic expression as we do with arithmetic without advancing the time. Read more
Carries out the tock-phase of a clock cycle: HIGH

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.