ENEE150 - Pointers - I. Pointers a. Pointers have to do...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
I. Pointers a. Pointers have to do with naming variables. b. They access variables not by symbolic names but location in memory. c. Location/address is a number. You can compute on it, that’s why it’s powerful. You can’t compute on a symbol. It allows you to know where everything is in memory. Allows access to hardware pretty directly. II. Data Representation a. Primitive – int, char, float, double. b. Binary encoding of integer values. b.i. Electrical signal encodes 2 values: 0 and 1 = bit of information. b.i.1. High voltage / current encodes 1 b.i.2. Low voltage / current encodes 0 b.i.3. Assemble multiple bits for larger values b.i.4. 2: 10, 3: 11, 4: 100, 5:101, 6:110…. 109: 1101101 (every digit is a component of 2^x) = 1*2^6+1*2^5+0*2^4+1*2^3+1*2^2+1*2^0 =64+32+0+8+4+0+1 = 109 b.ii. Conversion from binary to decimal: Sum(0 to k) {b[i] * 2^i} b.iii. Decimal to binary: successively divide by 2 and note the remainder: b.iii.1. 109/2 = 54 remainder 1 - least significant b.iii.2.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

ENEE150 - Pointers - I. Pointers a. Pointers have to do...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online