Ignore:
Timestamp:
Sep 17, 2010, 5:12:19 PM (10 years ago)
Author:
mulligan
Message:

Adding bit vector file.

File:
1 edited

Legend:

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

    r85 r86  
    1919  (* val from_string: string -> nibble option *)
    2020
    21   val to_bits: nibble -> (bit * bit * bit * bit)
     21  val to_bits: nibble -> bit list
    2222  val to_bit: nibble -> bit option
    2323  val to_int: nibble -> int
     
    7979      (false, false, false, b) -> Some (Bit.from_bool b)
    8080   |  _ -> None
    81   let to_bits (b1, b2, b3, b4) = (b1, b2, b3, b4)
     81  let to_bits (b1, b2, b3, b4) = [b1; b2; b3; b4]
    8282  let to_int (b1, b2, b3, b4) = (8 * Bit.to_int b1) + (4 * Bit.to_int b2) +
    8383                                (2 * Bit.to_int b3) + Bit.to_int b4
Note: See TracChangeset for help on using the changeset viewer.