... fill this in More...
#include <assert.h>
#include <stdio.h>
Go to the source code of this file.
Enumerations | |
enum | BIT { FALSE =0, TRUE =1 } |
Functions | |
BIT | not_gate (BIT A) |
BIT | or_gate (BIT A, BIT B) |
BIT | and_gate (BIT A, BIT B) |
BIT | xor_gate (BIT A, BIT B) |
BIT | rs_latch (BIT S, BIT R) |
BIT | d_latch (BIT D, BIT WE) |
int | adder (int O1, int O2, BIT carryIn, BIT *carryOut) |
BIT | multiplexer (BIT A, BIT B, BIT C, BIT D, BIT S1, BIT S0) |
void | decoder (BIT A, BIT B, BIT *O0, BIT *O1, BIT *O2, BIT *O3) |
... fill this in
BIT not_gate | ( | BIT | A | ) |
Simulates NOT logic gate.
A | input to the NOT gate |
Truth table
A return 0 1 1 0
BIT or_gate | ( | BIT | A, |
BIT | B | ||
) |
Simulates OR logic gate.
A | first input to the OR gate |
B | second input to the OR gate |
Truth table
A B return 0 0 0 0 1 1 1 0 1 1 1 1
BIT rs_latch | ( | BIT | S, |
BIT | R | ||
) |
Simulates RS latch circuit. Asserts if S = R = 0.
S | set input line |
R | reset input line |
Truth table
S R return 0 0 assert 0 1 1 1 0 0 1 1 previous output