Changeset 83 for Deliverables/D4.1/Byte.ml
 Timestamp:
 Sep 16, 2010, 3:31:33 PM (11 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Deliverables/D4.1/Byte.ml
r67 r83 4 4 (* operations on them. *) 5 5 (* CREATED: 10/09/2010, Dominic Mulligan *) 6 (* BUGS: 6 (* BUGS: `from_int' not yet implemented. *) 7 7 (*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*) 8 8 … … 20 20 val from_nibbles: nibble > nibble > byte 21 21 val from_nibble: nibble > byte 22 (* 23 val from_int: int > byte 24 *) 22 (* val from_int: int > byte *) 23 25 24 val to_bit: byte > bit option 26 25 val to_nibble: byte > nibble option … … 48 47 val zip_bit: (bit > bit > bit) > byte > byte > byte 49 48 val to_string: byte > string 49 50 val zero: byte 51 val half_add: byte > byte > (byte * bit) 52 val full_add: (byte * bit) > byte > (byte * bit) 50 53 end 51 54 … … 74 77 (Bit.from_bool false) (Bit.from_bool false) in 75 78 (n1, n2) 79 (* let from_int = assert false DPM: finish! *) 76 80 77 81 let get_nibble_at index (n1, n2) = … … 197 201 (new_n1, new_n2) 198 202 let to_string = iter_nibble Nibble.to_string 203 204 let zero = (Nibble.zero, Nibble.zero) 205 let half_add (l1, l2) (r1, r2) = 206 let (a2, c2) = Nibble.half_add l2 r2 in 207 let (a1, c1) = Nibble.full_add (l1, c2) r2 in 208 ((a1, a2), c1) 209 let full_add ((l1, l2), c) (r1, r2) = 210 let (a2, c2) = Nibble.full_add (l2, c) r2 in 211 let (a1, c1) = Nibble.full_add (l1, c2) r2 in 212 ((a1, a2), c1) 199 213 end;; 200 214
Note: See TracChangeset
for help on using the changeset viewer.