Changeset 92 for Deliverables/D4.1/physical.ml
 Timestamp:
 Sep 20, 2010, 5:40:16 PM (9 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Deliverables/D4.1/physical.ml
r91 r92 19 19  _ > raise Byte7_conversion 20 20 21 let add8_with_c b1 b2 c=21 let add8_with_c (b1 : [`Eight] vect) (b2 : [`Eight] vect) (c : bit) = 22 22 let n1 = int_of_vect b1 in 23 23 let n2 = int_of_vect b2 in 24 let c = int_of_ vect c in24 let c = int_of_bit c in 25 25 let res = n1 + n2 + c in 26 26 let ac = n1 mod 16 + n2 mod 16 + c >= 16 in … … 28 28 let res,c = res mod 256, res >= 256 in 29 29 let ov = c <> c6 in 30 vect_of_int res ,c,ac,ov30 vect_of_int res `Eight,c,ac,ov 31 31 ;; 32 32 … … 53 53 let inc b = 54 54 let res = int_of_vect b + 1 in 55 if res > 255 then vect_of_int 0 `Eight56 else vect_of_int res `Eight55 if res > 255 then (vect_of_int 0 `Eight : byte) 56 else (vect_of_int res `Eight : byte) 57 57 ;; 58 58
Note: See TracChangeset
for help on using the changeset viewer.