CS 1.4 Data

Cards (32)

  • Denary is base 10, Binary is base 2, Hexadecimal is base 16 - 0-F.
  • Converting denary to binary: take away the largest power of 2 possible from your number and continue until 0.
    Converting denary to hexadecimal: convert into an 8 digit binary number, then split this number into 2 nibbles and convert the 2 nibbles to hexadecimal.
    Converting hexadecimal into binary: split the hexadecimal into 2, convert both into denary and then into binay.
    Converting binary into hexadecimal: split into 2, convert each nibble into denary and then into hexadecimal.
    Why use hexadecimal? Are more human friendly, and uses less digits.
  • Data structure: A way of storing and manipulating data.
  • Data Type: What type of value a variable has and how it must be treated.
  • Array: A set of data items of the same type grouped together using a single identifier, it is static so the size cannot change and is base 0.
  • Dimension: How many indexes it has, a 1D, 2D or 3D array.
  • Records: Comprised multiple related attributes of different data types
  • Lists: ordered set of data that is not static- fixed in size.
  • Tuples: Immutable list - cannot be changed.
  • Binary addition rules0+1 = 11+1 = 0 (carry 1)1+1+1 = 1 (carry 1)
    0+0 = 0
  • Sign and Magnitude: Where the leftmost bit is 1 to represent a negative number or 0 to represent a positive number. This bit is NOT included when you add them up.
  • Two's Complement: Where if the leftmost bit is a 1 it becomes a negative number and IS added in the calculations.
  • Two's Complement to unsigned bits: Take the binary in TC and flip the bits. Add one.
  • Denary to TC: Write the negative number as a positive one in binary, flip the bits and add one.
  • Borrowing: During binary subtraction, when borrowing from the next number, you borrow 2 not 1.
  • Negative subtraction: 6-7 is the same as 6+-7, so you can do addition.
  • Binary subtraction rules1 - 1 = 00 - 0 = 00 - 1 = 1 (after carrying)
    1 - 0 = 1
  • Bitwise OperationsLeft Shift:Multiplies by 2.Most significant bit is lost and 0 fills least significant bit.Right Shift:Divides by 2.Least significant bit is lost and 0 fills the most significant bit.Can lead to overflow errors.
  • AND or & Both bits in the calculation must be 1 for the output to be 1
    OR or | Either bits can be one for the output to be one in this calculation.
    XOR or ^ Only one bit can be 1 for the output to be one.
  • Bit Mask: A bit mask is data used with a bit wise operator.
  • Karnaugh Maps: A method to simplify Boolean algebra expressions.
  • Truth table Into Karnaugh Map:1.Put variables on Karnaugh grid.2.Write out inputs: 00 01 11 10.3.Where the expression is true, put a one in the grid.4.Fill in the 0s.5.Find the common variables where the ones are.6.Write out the expressions with OR between them.
  • An adder is a logic circuit that is used for the addition of binary numbers.A binary half adder circuit adds two 1-bit binary numbers together. Is an XOR and AND gate.A full adder adds three 1-bit binary numbers together. I made of 2 half adders and a OR gate.They return a C(Carry-out)
  • D-Type Flip Flop: Are used in S-RAM.A flip flop stores the value of a single bit.They are positive edge triggered, meaning that they can only change the output when the clock is at a rising edge.
  • Absorption Laws:
    A Λ (A V B) = AA V (A Λ B) = A
  • AND Laws:
    A ∧ 0 = 0A1 = AA ∧ A = AA ∧¬A = 0
  • Associative Laws:
    (A Λ B) Λ C = A Λ (B Λ C)(A V B) V C = A V (B V C)
  • Commutative Laws:
    A Λ B = B Λ AA V B = B V A
  • De Morgan's Laws:
    ¬(A Λ B) = (¬A V ¬B)¬(A V B) = (¬A Λ ¬B)
  • Distributive Laws:
    A Λ (B V C) = ( A Λ B ) V (A Λ C)A V (B Λ C) = ( A V B ) Λ (A V C)
  • Inversion Law:
    ¬¬A = A
  • OR Laws:
    A ∨ 0 = AA1 = 1A ∨ A = AA ∨¬A = 1