1.1 Binary Hex Number Systems Flashcards

1
Q

Why do computers use binary to represent all forms of data?

A
  • Any form of data needs to be converted to binary to be processed by a computer
  • Data is processed using logic gates and stored in registers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Explain the concept of overflow and why it occurs in binary addition

A
  • A computer or a device has a predefined limit that it can represent or store e.g. 16-bits
  • Overflow errors happen when the largest number that a CPU register can hold is exceeded.
  • The number of bits that a CPU can handle is called the word size.
  • When adding 2 binary numbers an overflow error occurs when a value outside this limit is stored e.g if the value is greater than 255 in an 8-bit register
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Explain the difference between the binary and denary number systems

A
  • Binary base 2 system
    • Denary base 10 system
  • Binary has 2 digits (0 and 1)
    • Denary has 10 digits (0-9)
  • Binary place values are powers of 2
    • Denary place values are powers of 10
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the binary place values for a byte?

A

128 64 32 16 8 4 2 1

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

Convert the binary number 10011011 into denary

A

155

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

Convert the denary value 156 into binary

A

10011100

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

What is the largest value that can be stored in 8 bits?

A

255

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

What is the largest value that can be stored in 10 bits?

A

1023

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

What would be the effect of shifting the bits 1 place to the left for the binary value 0001 1101

A
  • Multiplying by 2
  • 0001 1101 = 29
  • 00111010 = 58
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What would be the effect of shifting bits 3 places to the left?

A
  • multiply by 8 or multiply by 2 x 2 x 2 or multiply by 2^3
  • 0000 0110 = 6
  • 0011 0000 = 48
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What would be the effect of shifting bits 2 places to the right?

A
  • divide by 4 or divide by 2^2
  • 0001 0000 = 16
  • 0000 0100 = 4
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How many bits in a byte?

A

8

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

How many bits in a nibble?

A

4

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

How many nibbles in 4 bytes?

A

8

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

What is a register?

A
  • A register is a small amount of internal memory
  • Used for fast reading and writing
  • It is temporary/volatile (loses data once there is no power)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the rules you need to remmeber for binary addition?

A
  • 0 + 1 = 1
  • 1+ 1 = 2 = 0 Carry 1
  • 1+1+1 = 3 = 1 Carry 1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Add the 2 binary values 00100111 + 01001010

A

01110001

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

Add the 2 binary values 01110010 + 11111001. If you tried to store the result in word size of 8 bits what error would occur?

A

Requires 9 bits (101101011) so overflow error

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

What are the binary place values for a 2’s Complement byte?

A

-128 64 32 16 8 4 2 1

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

What is the smallest value that can be stored in a 2’s Complement byte?

A
  • -128 64 32 16 8 4 2 1
  • 1 0 0 0 0 0 0 0= -128
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is the largest value that can be stored in a 2’s Complement byte?

A
  • -128 64 32 16 8 4 2 1
  • 0 1 1 1 1 1 1 1 = 127
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Negative denary numbers can be represented as binary using ….

A

2’s Complement

23
Q

Convert the 2’s Complement binary number below to denary

11111111

A

-1

24
Q

Convert the 2’s Complement binary number below to denary

10001000

A

-120

25
Q

Convert the denary number below to 2’s Complement binary

-19

A

11101101

26
Q

Convert the denary number below to 2’s Complement binary

-7

A

11111001

27
Q

What is hexadecimal?

A
  • Base 16 number system
  • 16 choices of digits (0-9, A-F)
  • Place values are powers of 16
28
Q

What are the place values for the hexadecimal value A7F3?

A
  • 4096 256 16 1
  • A 7 F 3
29
Q

What is the denary value of the hex digit A?

A

10

30
Q

What is the denary value of the hex digit E?

A

14

31
Q

What is the denary value of the hex digit 7?

A

7

32
Q

Convert the hex value AAA to Denary

A

2730

33
Q

Convert the following hex values to denary

  • 1F
  • 42
  • CC
A
  • 1F = 31
  • 42 = 66
  • CC = 204
34
Q

Convert the hex value CA to Binary

A

11001010

35
Q

Convert the following hexadecimal values to binary

  • B3
  • 5A
  • B0F
A
  • B3 = 1011 0011
  • 5A = 0101 1010
  • B0F = 1011 0000 1111
36
Q

Convert the binary value 1111 1010 to hexadecimal

A

FA

37
Q

Convert the following binary values to hexadecimal

  • 1011 1101
  • 1010 0110
  • 1111 1010 1100 1110
A
  • 1011 1101 = BD
  • 1010 0110 = A6
  • 1111 1010 1100 1110 = FACE
38
Q

Convert the hex value AB to Denary

A

171

39
Q

Convert the denary value 166 to hexadecimal

A

A6

40
Q

Convert the following denary values to hexadecimal

  • 22
  • 42
  • 170
A
  • 22 = 16
  • 42 = 2A
  • 170 = AA
41
Q

Why do we use hexadecimal?

A
  • Easier for programmers to read and understand
  • Conversion to binary easier than denary to binary
  • Takes up less space when displayed or printed
  • Faster than binary for entering numbers
42
Q

Where is Hexadecimal used?

A
  • HTML colour codes e.g. red = #FF0000
  • Display MAC (Media Access Control) addresses e.g. 01-23-45-67-89-AB-CD
  • Display ASCII or Unicode values e.g. %41 = 65 = A
  • Display error codes e.g. error #404 page not found
  • Display memory dumps e.g. 5F 3A 09 F1
43
Q

What is ASCII?

A
  • American Standard Code for Information Interchange.
  • It is a code for representing 128 English characters as numbers
  • Each character is assigned a number from 0 to 127
44
Q

How many bits does ASCII use?

A

7 bits

45
Q

How many characters can be represented using ASCII?

A
  • Uses 7 bits so …
  • 000 0000 to 111 1111 = 0 to 127 = 128 unique characters (2^7)
46
Q

How many bits does extended ASCII use?

A

8

47
Q

How many characters can be represented using extended ASCII?

A
  • 0000 0000 to 1111 1111 = 0 to 255 = 256 unique characters (2^8)
48
Q

How many bits does Unicode use?

A

16

49
Q

How many characters can be represented using Unicode?

A
  • Uses 16 bits so … 65536 unique characters (2^16)
50
Q

Describe the difference between ASCII and Unicode

A
  • ASCII uses 7 (or 8 bits) and can represent 128 (or 256 characters)
  • Unicode uses 16 bits and can represent 2^16 characters.
51
Q

Describe one advantage of Unicode

A

Can represent a wider range of characters and therefore more languages than ASCII

52
Q

Describe one disadvantage of Unicode

A

Each character uses more memory space than ASCII

53
Q

Describe what is meant by a character set

A
  • All the characters and symbols that can be represented by a computer system.
  • Each character and symbol is assigned a unique value.