-
Notifications
You must be signed in to change notification settings - Fork 0
/
arithmetic_integer_operations.h
72 lines (59 loc) · 1.09 KB
/
arithmetic_integer_operations.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#ifndef ARITHMETIC_INTEGER_OPERATIONS_H
#define ARITHMETIC_INTEGER_OPERATIONS_H
#include <limits.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "string_helper.h"
#include "circuits.h"
void add(
unsigned * first,
unsigned * second,
unsigned * carry,
int size,
unsigned * result);
void signed_add(
int * first,
int * second,
int * carry,
int * overflow,
int size,
int * result);
char * output_add(
char * first,
char * second,
char * carry,
int size,
char * result);
void multiply(
unsigned * first,
unsigned * second,
int size_first,
int size_second,
unsigned * result);
char * output_multiply_algorithm(
char * first,
char * second,
int size_first,
int size_second,
char * result);
void mapAnd(
unsigned * array,
unsigned * result,
unsigned operand,
int size);
char * output_map_and(
char * array,
char * result,
char * operand,
int size);
void encode_bitslice(
unsigned * input,
unsigned * output,
int size);
void decode_bitslice(
unsigned * input,
unsigned * output,
int size);
void print_binary_array(unsigned * array, int size);
#endif