Module 2: Binary Representation Flashcards

1
Q

bit

A

“binary digit”
1 bit = a bit
4 bits = a nibble
8 bits = a byte

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

digital

A

finite number of symbols (opposite is analog)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

weighted positional representation

A

a positional number system represents numeric values as sequences of one or more digits. each digit in the representation is weighted according to its position in the number

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

unsigned numbers

A

positive numbers and zero

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

signed numbers

A

negative numbers, zero, and positive numbers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

unsigned overflow

A

when an operation result goes beyond the width of memory location in a computer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

signed overflow

A

when you add 2 positive numbers and get a negative result or if you add 2 negative numbers and get a positive result

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

sign extenstion

A

when performing arithmetic operations on numbers of different width we must sign-extend numbers (which means “replicating the sign bit” 0 or 1 before the number of smaller width) before performing operations so that both numbers are the same width

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

encoding

A

“encoding” data simply means an agreed upon “mapping” of data from one representation to another

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Binary digital system

A

absence of voltage and presence of voltage
OFF/ON
0 or 1
EVERYTHING is sequences of 0s and 1s

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Non-negative integers in binary

A

representation of integer in binary
subtraction, multiplication, and division also similar to base 10
note: n-bit multiplication produces 2n-bit results
overflow example: 15+1 with 4-bit integers (16 needs 5 bits 10000)
in this example, our computer has a 4-bit width and we’ve gone past it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

negative integers in binary

A

sign-magnitude: place a “1” in front of a number:
0001 is “+1”
1001 is “-1”
leading # indicates the sign of the number

1C: take the positive representation of a binary number and flip aka “complement” each bit

  • assuming 4-bit width
  • +5 in 1C: 0101 (must pad with leading 0)
  • -5 in 1C: 1010 (simply flip each digit)

2C: 1C + 1 and omit any resulting carry-out past the width of the machine

  • +5 in 2C would be 0101 (must pad with leading 0)
  • -5 in 2C would be 1011 (add one to get the 2C)
  • advantage: only 1 representation of 0
  • computers can add positive and negative numbers together
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

converting numbers to/from 2C

A

copy bits from right to left up to and including the first “1” and flip remaining bits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

sign extension

A

if a number is positive (leading 0) pad with 0s

if a number is negative (leading 1) pad with 1s

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

encoding

A

ASCII: American Standard Code for Information Interchange
2^7 = 128 combinations
UNICODE = 2^32 possibilities

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Hexadecimal representation

A

01101101 = 0110 1101 = x6D

17
Q

Fractions in binary

A

2C addition and subtraction still work

To do this, we align the binary points

18
Q

Floating-point

A

sign, fraction, and exponent

N = (-1)^s x 1.fraction x 2^(exponent-127)