source: Deliverables/D4.1/BitVectors.mli @ 92

Last change on this file since 92 was 92, checked in by mulligan, 9 years ago

Fixed physical interface file. Refactoring ASMInterface.

File size: 1.6 KB
Line 
1type bit = bool
2
3type 'a vect
4
5type nibble = [`Four] vect
6type byte7 = [`Seven] vect
7type byte = [`Eight] vect
8type word = [`Sixteen] vect
9type word11 = [`Eleven] vect
10
11type sizes = [ `Four | `Seven | `Eight | `Eleven | `Sixteen ]
12
13val mk_nibble: bit -> bit -> bit -> bit -> nibble
14val from_nibble: nibble -> bit * bit * bit * bit
15val mk_byte7: bit -> bit -> bit -> nibble -> byte7
16val from_byte7: byte7 -> bit * bit * bit * nibble
17val mk_byte: nibble -> nibble -> byte
18val from_byte: byte -> nibble * nibble
19val mk_word: byte -> byte -> word
20val from_word: word -> byte * byte
21val mk_word11: bit -> bit -> bit -> byte -> word11
22val from_word11: word11 -> bit * bit * bit * byte
23
24val to_bits: 'a vect -> bit list
25val get_bit: 'a vect -> int -> bit option
26val set_bit: 'a vect -> int -> bit -> 'a vect option
27
28val int_of_vect: 'a vect -> int
29val vect_of_int: int -> ([< sizes] as 'a) -> 'a vect
30
31val (-&-): 'a vect -> 'a vect -> 'a vect
32val (-|-): 'a vect -> 'a vect -> 'a vect
33val (-^-): 'a vect -> 'a vect -> 'a vect
34val not: 'a vect -> 'a vect
35
36val iter_bits: (bit -> string) -> 'a vect -> string
37val map_bits: (bit -> bit) -> 'a vect -> 'a vect
38val map2_bits: (bit -> bit -> bit) -> 'a vect -> 'a vect -> 'a vect
39
40val string_of_vect: 'a vect -> string
41
42val zero: [< `Four | `Seven | `Eight | `Eleven | `Sixteen ] -> [< `Four | `Seven | `Eight | `Eleven | `Sixteen ] vect
43
44val half_add: 'a vect -> 'a vect -> bit * 'a vect
45val full_add: 'a vect -> 'a vect -> bit -> bit * 'a vect
46
47val rotate_left : 'a vect -> 'a vect
48val rotate_right : 'a vect -> 'a vect
49val shift_right : 'a vect -> 'a vect
50val shift_left : 'a vect -> 'a vect
Note: See TracBrowser for help on using the repository browser.