aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux/nand/nand.c
blob: f808f311d0661c4711409152cbb69a2a1fa91cdd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <stdio.h>

unsigned not(unsigned x) {
  return ~x;
}

unsigned nand(unsigned x, unsigned y) {
  return ~(x & y);
}

unsigned nor(unsigned x, unsigned y) {
  return ~(x | y);
}

unsigned nxor(unsigned x, unsigned y) {
  return ~(x ^ y);
}

int main() {
  unsigned x = 0xF4, y = 0x33;
  printf("%X\n", nxor(x, y));
}