Changeset 91 for Deliverables/D4.1/physical.ml
 Timestamp:
 Sep 20, 2010, 3:30:27 PM (11 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Deliverables/D4.1/physical.ml
r90 r91 8 8 Map.Make (struct type t = word let compare = Pervasives.compare end) 9 9 10 let byte7_of_byte = 11 function 12 (false,b2,b3,b4),n > (b2,b3,b4,n) 13  _ > raise Byte7_conversion 10 let int_of_bit = 11 function 12 false > 0 13  true > 1 14 15 let byte7_of_byte b = 16 let bits = to_bits b in 17 match bits with 18 [false;b1;b2;b3;b4;b5;b6;b7] > mk_byte7 b1 b2 b3 (mk_nibble b4 b5 b6 b7) 19  _ > raise Byte7_conversion 14 20 15 21 let add8_with_c b1 b2 c = … … 25 31 ;; 26 32 27 let subb8_with_c b1 b2 c=33 let subb8_with_c (b1 : [`Eight] vect) (b2 : [`Eight] vect) (c : bit) = 28 34 let n1 = int_of_vect b1 in 29 35 let n2 = int_of_vect b2 in 30 let c = int_of_ vect c in36 let c = int_of_bit c in 31 37 let res = n1  n2  c in 32 38 let ac = n1 mod 16  n2 mod 16  c < 0 in … … 52 58 53 59 let byte7_of_bit b = 54 false,false,false,(false,false,false,b)60 [false;false;false;false;false;false;b] 55 61 ;; 56 62 57 let byte_of_byte7 ( b1,b2,b3,n) =58 (false,b1,b2,b3),n63 let byte_of_byte7 ([b1;b2;b3]::n) = 64 [false;b1;b2;b3]::n 59 65 ;;
Note: See TracChangeset
for help on using the changeset viewer.