Skip to main content

Lanes

Trait Lanes 

Source
pub trait Lanes {
    // Required methods
    fn shape(&self) -> LaneShape;
    fn add(&mut self, a: u32, b: u32, cin: u32) -> (u32, u32);
    fn sub(&mut self, a: u32, b: u32, bin: u32) -> (u32, u32);
    fn mul(&mut self, a: u32, b: u32) -> u32;
}
Expand description

A device’s datapath executing lane operations. The arithmetic ones are where devices differ (exact digital units, or the analog plane settling a column); the rest are the digital side of every device.

Required Methods§

Source

fn shape(&self) -> LaneShape

Source

fn add(&mut self, a: u32, b: u32, cin: u32) -> (u32, u32)

(a + b + cin) mod 2^w and its carry.

Source

fn sub(&mut self, a: u32, b: u32, bin: u32) -> (u32, u32)

(a − b − bin) mod 2^w and its borrow.

Source

fn mul(&mut self, a: u32, b: u32) -> u32

The exact product of two mul-bit operands.

Implementors§