Enumerations | Functions
logic.h File Reference

... 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)
 

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