My Project
Functions
logic.c File Reference

... fill this in More...

#include "logic.h"

Functions

BIT not_gate (BIT A)
 
BIT or_gate (BIT A, BIT B)
 
BIT rs_latch (BIT S, BIT R)
 

Detailed Description

... fill this in

Author
... fill this in
Date
... fill this in

Function Documentation

BIT not_gate ( BIT  A)

Simulates NOT logic gate.

Parameters
Ainput to the NOT gate
Returns
NOT gate output, returns NOT A

Truth table

       A   return
       0   1
       1   0
BIT or_gate ( BIT  A,
BIT  B 
)

Simulates OR logic gate.

Parameters
Afirst input to the OR gate
Bsecond input to the OR gate
Returns
returns A OR B

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.

Parameters
Sset input line
Rreset input line
Returns
returns RS latch output

Truth table

       S R  return
       0 0   assert
       0 1   1 
       1 0   0 
       1 1   previous output