Cs book

Cards (417)

  • Binary
    Base two number system based on the values 0 and 1 only
  • Bit
    Abbreviation for binary digit
  • One's complement
    Each binary digit in a number is reversed to allow both negative and positive numbers to be represented
  • Two's complement
    Each binary digit is reversed and 1 is added in right-most position to produce another method of representing positive and negative numbers
  • Sign and magnitude
    Binary number system where left-most bit is used to represent the sign (0 = + and 1 = –); the remaining bits represent the binary value
  • Hexadecimal
    A number system based on the value 16 (uses the denary digits 0 to 9 and the letters A to F)
  • Memory dump
    Contents of a computer memory output to screen or printer
  • Binary-coded decimal (BCD)
    Number system that uses 4 bits to represent each denary digit
  • ASCII code
    Coding system for all the characters on a keyboard and control codes
  • Character set
    A list of characters that have been defined by computer hardware and software. It is necessary to have a method of coding, so that the computer can understand human characters
  • Unicode
    Coding system which represents all the languages of the world (first 128 characters are the same as ASCII code)
  • Every one of us is used to the decimal or denary (base 10) number system. This uses the digits 0 to 9 which are placed in 'weighted' columns
  • Designers of computer systems adopted the binary (base 2) number system since this allows only two values, 0 and 1. No matter how complex the system, the basic building block in all computers is the binary number system
  • Bit
    Each of the binary digits are known as bits
  • Binary number system column weightings
    • 128
    • 64
    • 32
    • 16
    • 8
    • 4
    • 2
    • 1
  • Converting from binary to denary
    Each time a 1 appears in a column, the column value is added to the total
  • Converting from denary to binary
    Successive division by 2; the remainders are then written from bottom to top to give the binary value
  • One's complement
    Each digit in the binary number is inverted (0 becomes 1 and 1 becomes 0)
  • Two's complement
    Each digit in the binary number is inverted and a '1' is added to the right-most bit
  • Two's complement 8-bit number representation
    • -128
    • 64
    • 32
    • 16
    • 8
    • 4
    • 2
    • 1
  • Throughout the remainder of this chapter, we will use the two's complement method to avoid confusion. Also, two's complement makes binary addition and subtraction more straightforward. The reader is left to investigate one's complement and the sign and magnitude method in binary arithmetic.
  • Now that we are introducing negative numbers, we need a way to represent these in binary. The two's complement uses these weightings for an 8-bit number representation:
  • Two's complement 8-bit number representation
    • -128
    • 64
    • 32
    • 16
    • 8
    • 4
    • 2
    • 1
  • This means:
  • The easiest way to convert a number into its negative equivalent is to use two's complement. For example, 104 in binary is 0 1 1 0 1 0 0 0.
    1. bit binary column weightings
    • -128
    • 64
    • 32
    • 16
    • 8
    • 4
    • 2
    • 1
  • IEC memory size system
    • Name of memory size
    • Number of bytes
    • Equivalent denary value (bytes)
    1 kibibyte (1 KiB)
    • 2^10
    • 1 024
    1 mebibyte (1 MiB)
    • 2^20
    • 1 048 576
    1 gibibyte (1 GiB)
    • 2^30
    • 1 073 741 824
    1 tebibyte (1 TiB)
    • 2^40
    • 1 099 511 627 776
    1 pebibyte (1 PiB)
    • 2^50
    • 1 125 899 906 842 624
  • This system is more accurate. Internal memories (such as RAM) should be measured using the IEC system. A 64 GiB RAM could, therefore, store 64 × 2^30 bytes of data (68 719 476 736 bytes).
  • The most obvious use of BCD is in the representation of digits on a calculator or clock display.
  • Each denary digit will have a BCD equivalent value which makes it easy to convert from computer output to denary display.
  • As you will learn in Chapter 13, it is nearly impossible to represent decimal values exactly in computer memories which use the binary number system. Normally this doesn't cause a major issue since the differences can be dealt with. However, when it comes to accounting and representing monetary values in computers, exact values need to be stored to prevent significant errors from accumulating. Monetary values use a fixed-point notation, for example $1.31, so one solution is to represent each denary digit as a BCD value.
  • Binary addition
    1. 0 + 0 = 0
    2. 0 + 1 = 1
    3. 1 + 0 = 1
    4. 1 + 1 = 1 with carry 1
  • This produces 1 1 0 1 which isn't a denary digit; this will flag an error and the computer again needs to add 0 1 1 0
  • Adding 0 1 1 0 to 1 1 0 1

    1. 1 1 0 1
    2. 0 1 1 0
    3. 1 0 0 1 1
  • Adding 1 to 0 0 0 0 0 0 0 0 produces 0 0 0 0 0 0 0 1
  • Final answer: 0 0 0 0 0 0 0 1 which is 1.31 in denary – the correct answer
  • ASCII code

    American Standard Code for Information Interchange, set up in 1963 for use in communication systems and computer systems
  • The standard ASCII code character set consists of 7-bit codes (0 to 127 denary or 0 to 7F in hexadecimal)
  • The 32 control codes use up codes 0 to 31 (denary) or 0 to 19 (hexadecimal)
  • The sixth bit changes from 1 to 0 when comparing lower and uppercase characters