Shared Flashcard Set

Details

Number Representations -- Datatypes: Part 1
Exam 1
35
Computer Science
Undergraduate 2
10/14/2015

Additional Computer Science Flashcards

 


 

Cards

Term
A mathematical concept; E.g.: Natural numbers, integers, reals, rationals
Definition
number
Term
Used to represent a number
Definition
symbol
Term
Computer is a _____ _____ system
Definition
binary, digital
Term
Discrete; finite number of symbols; opposite is _____ (continuous)
Definition
digital, analog
Term
(Base two); 2 symbols/states/values; 0 and 1 (or letters 'O' and 'I')
Definition
binary
Term
Basic unit of information, also called the binary digit
Definition
bit
Term
n bits -> _____ possible states
Definition
2n
Term
Operates by controlling the flow of electrons
Definition
electrical
Term
_____ data, simply means an agreed upon _____ of data from one representation to another
Definition
Encoding, mapping
Term
27=128 combinations; standard encoding, developed in the 1960s, didn't take into account international standards
Definition
ASCII (American Standard Code for Information Interchange)
Term
8-bit encoding, 28=256 possibilities
Definition
Unicode
Term
More details=more _____
Definition
bits
Term
What is the most and least significant digit in 101?
Definition
MS: 1st 1, LS: 2nd 1
Term
Radix-10: _____ Radix 2: _____ Radix 16: _____
Definition
decimal, binary, hex
Term
Use k symbols- also known as k-ary numbers
Definition
Radix-k notation
Term
How many different radix k numbers of length n?
Definition
kn
Term

What does this algorithm do?

//input is Decimal number N, output is list of bits bi

i=0;

while N>0

do bi=N%r; //bi=remainder; N mod r

N=N/r; //N becomes quotient of division i++;

end while

Definition
Computes the base r representation for N
Term
When operation result is outside type's range
Definition
Overflow(carry-out)
Term
The sum of 2 n-bit numbers can have _____ bits
Definition
n+1
Term
The product of 2 n-bit numbers can have _____ bits
Definition
2n
Term
Architecture remembers overflow (carry-out) bit
Definition
Addition
Term
Overflow: Architecture stores upper n-bits in register. Can use these if you want.
Definition
Multiplication
Term
single binary digit
Definition
bit
Term
collection of 8 bits
Definition
byte
Term
collection of 4 bits
Definition
nibble
Term
In a computer memory each storage location can only hold a _____ number of bits
Definition
finite
Term
If we use an n-bit storage location to store a 'regular' unsigned number we can store numbers between 0 and _____ inclusive.
Definition
2n-1
Term
What negative representation are these? 00101=5 10101=-5 00101=5 11010=-5
Definition
sign-magnitude, 1's Complement
Term
Range of Signed Magnitude, 1's Complement, 2's Complement
Definition
-2N-1+1<i<2N-1-1, -2N-1+1<i<2N-1-1, -2N-1<i<2N-1-1
Term
To represent a number X we actually compute and store (2n+X)
Definition
2's Complement
Term
Advantages of _____ _____- operations need not check the sign, only 1 representation for zero, efficient use of all the bits
Definition
2's Complement
Term
Arithmetic Overflow: Any addition that produces an 'extra bit' is a problem; Sometimes addition or subtraction produce an extra bit- this is not necessarily a problem, Arithmetic overflow can occur when you are adding 2 positive or 2 negative numbers- in this case if the sign of the result is _____ from the sign of the addends you have an arithmetic overflow
Definition
Unsigned numbers, 2's Complement signed numbers, different
Term
2's Complement Pencil-and-Paper Shortcut: Copy bits from _____ to _____ up to and including the first _____. _____ remaining bits.
Definition
right, left, 1, flip
Term

Converting Decimal to Binary (2's C)

1. Find magnitude of decimal number. (Always _____.)

2. Divide by _____ - remainder is _____ significant bit.

3. Keep dividing by 2 until answer is _____, writing remainders from _____ to _____.

4. Append a _____ as the _____ bit; if original number was _____, take 2's Complement.

Definition
positive, 2, least, 0, right, left, 0, MS, negative
Term
To add 2 different sized bits, pad the smaller sized bits on the _____ with the _____ bit.
Definition
left, sign
Supporting users have an ad free experience!