Ignore:
Timestamp:
Sep 20, 2010, 3:30:27 PM (10 years ago)
Author:
mulligan
Message:

Finished porting/fix type errors in physical.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D4.1/physical.ml

    r90 r91  
    88  Map.Make (struct type t = word let compare = Pervasives.compare end)
    99
    10 let byte7_of_byte =
    11  function
    12     (false,b2,b3,b4),n -> (b2,b3,b4,n)
    13   | _ -> raise Byte7_conversion
     10let int_of_bit =
     11  function
     12    false -> 0
     13  | true -> 1
     14
     15let 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
    1420
    1521let add8_with_c b1 b2 c =
     
    2531;;
    2632
    27 let subb8_with_c b1 b2 c =
     33let subb8_with_c (b1 : [`Eight] vect) (b2 : [`Eight] vect) (c : bit) =
    2834 let n1 = int_of_vect b1 in
    2935 let n2 = int_of_vect b2 in
    30  let c = int_of_vect c in
     36 let c = int_of_bit c in
    3137 let res = n1 - n2 - c in
    3238 let ac = n1 mod 16 - n2 mod 16 - c < 0 in
     
    5258
    5359let byte7_of_bit b =
    54   false,false,false,(false,false,false,b)
     60  [false;false;false;false;false;false;b]
    5561;;
    5662
    57 let byte_of_byte7 (b1,b2,b3,n) =
    58         (false,b1,b2,b3),n
     63let byte_of_byte7 ([b1;b2;b3]::n) =
     64        [false;b1;b2;b3]::n
    5965;;
Note: See TracChangeset for help on using the changeset viewer.