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

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

Timers implemented (including demonic thirteen bit timer).

File size: 1.9 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 mk_byte_from_bits: ((bit * bit * bit * bit) * (bit * bit * bit * bit)) -> byte
19val from_byte: byte -> nibble * nibble
20val bits_of_byte: byte -> ((bit * bit * bit * bit) * (bit * bit * bit * bit))
21val mk_word: byte -> byte -> word
22val from_word: word -> byte * byte
23val mk_word11: bit -> bit -> bit -> byte -> word11
24val from_word11: word11 -> bit * bit * bit * byte
25
26val get_bit: 'a vect -> int -> bit
27val set_bit: 'a vect -> int -> bit -> 'a vect
28
29val int_of_vect: 'a vect -> int
30val vect_of_int: int -> ([< sizes] as 'a) -> 'a vect
31val string_of_bit: bit -> string
32val string_of_vect: 'a vect -> string
33val hex_string_of_vect: 'a vect -> string
34
35val (-&-): 'a vect -> 'a vect -> 'a vect
36val (-|-): 'a vect -> 'a vect -> 'a vect
37val (-^-): 'a vect -> 'a vect -> 'a vect
38val complement: 'a vect -> 'a vect
39
40val iter_bits: (bit -> string) -> 'a vect -> string
41val map_bits: (bit -> bit) -> 'a vect -> 'a vect
42val map2_bits: (bit -> bit -> bit) -> 'a vect -> 'a vect -> 'a vect
43
44val string_of_vect: 'a vect -> string
45
46val zero: [< `Four | `Seven | `Eight | `Eleven | `Sixteen ] -> [< `Four | `Seven | `Eight | `Eleven | `Sixteen ] vect
47
48val half_add: 'a vect -> 'a vect -> bit * 'a vect
49val full_add: 'a vect -> 'a vect -> bit -> bit * 'a vect
50val sign_extension: byte -> word
51
52val rotate_left : 'a vect -> 'a vect
53val rotate_right : 'a vect -> 'a vect
54val shift_right : 'a vect -> 'a vect
55val shift_left : 'a vect -> 'a vect
Note: See TracBrowser for help on using the repository browser.