lect_01 - CSI 333 Lecture 1 Number Systems 11 / 23 Basics...

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

View Full Document Right Arrow Icon
CSI 333 – Lecture 1 Number Systems 1–1 / 23
Background image of page 1

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

View Full DocumentRight Arrow Icon
Basics of Number Systems Ref: Weighted Positional Notation: 192 = 2 × 10 0 + 9 × 10 1 + 1 × 10 2 General: Digit sequence : d n - 1 d n - 2 . . . d 1 d 0 Value : n - 1 X i =0 ( d i × 10 i ) Decimal system: Base (or Radix) : 10 Digits : 0, 1, 2, . . . , 9 1–2 / 23
Background image of page 2
Number Systems (continued) Base r system: Digits : 0, 1, . . . , r - 1 Digit sequence : s n - 1 s n - 2 . . . s 1 s 0 Value : n - 1 X i =0 ( s i × r i ) s 0 - - Least significant digit s n - 1 - - Most significant digit 1–3 / 23
Background image of page 3

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

View Full DocumentRight Arrow Icon
Number Systems (continued) Common Values for Radix r : r = 2 : Binary - - Digits: 0, 1. r = 8 : Octal - - Digits: 0, 1 . . . , 7. r = 10 : Decimal - - Digits: 0, 1, . . . , 9. r = 16 : Hexadecimal (Hex) - - Digits: 0, 1, . . . , 9, A, B, C, D, E, F (where A = 10, B = 11, . . . , F = 15). Convention: Base written as subscript (e.g. 277 8 ). 1–4 / 23
Background image of page 4
Converting from any base to Decimal Example 1: Find the decimal value of 277 8 . 277 8 = 7 × 8 0 + 7 × 8 1 + 2 × 8 2 = 7 + 56 + 128 = 191 10 Example 2: Find the decimal value of 3 F 4 16 . 3 F 4 16 = 4 × 16 0 + 15 × 16 1 + 3 × 16 2 = 4 + 240 + 768 = 1012 10 1–5 / 23
Background image of page 5

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

View Full DocumentRight Arrow Icon
Converting to Decimal (continued) Example 3: Find the decimal value of 10110 2 . 10110 2 = 2 1 + 2 2 + 2 4 = 2 + 4 + 16 = 22 10 Convention in C : 315 - - Decimal 0315 - - Octal 0x315 - - Hex Machine hardware: Uses binary. 1–6 / 23
Background image of page 6
Note: Each octal digit - - 3 bits Each hex digit - - 4 bits Examples: 6 8 = 110 2 C 16 = 1100 2 Converting from Binary to Octal: 1 Moving from right to left, form groups of three bits. (May need to add leading zeros.)
Background image of page 7

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

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

This note was uploaded on 11/22/2010 for the course ICSI 333 taught by Professor Ravi during the Spring '10 term at SUNY Albany.

Page1 / 23

lect_01 - CSI 333 Lecture 1 Number Systems 11 / 23 Basics...

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

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