Week04

# Week04 - ULI101 Week 04 Week Overview Data Representation...

This preview shows pages 1–11. Sign up to view the full content.

ULI101 Week 04

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

View Full Document
Week Overview Data Representation Binary, octal, decimal and hexadecimal numbering systems Number conversions Unix file permissions Regular file vs. directory permissions
Data Representation Why Study Data Representation? Most computers today are digital (binary numbers – 0’s or 1’s) Most computers only understand binary numbers. Any information stored or processed on the computer is represented by binary numbers.

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

View Full Document
Data Representation Why Study Data Representation? For many aspects of programming and networking, the details of data representation must be understood: C Programming – sending information over networks, files Unix / Linux – setting permissions for files and directories Web Pages – setting color codes
Data Representation In terms of this course, we will learn how a simple decimal number (integer) is stored into the computer system as a binary number. We will also learn other numbering systems (octal and hexadecimal) that can be used as a “short-cut” to represent binary numbers.

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

View Full Document
Data Representation Before we learn numbering systems, we have to “go- back in time” to see how we learned the decimal numbering system. The decimal numbering system (base 10) uses 10 symbols for each digit (0, 1, 2, … 9). Since most humans have 10 extensions on their hands (2 thumbs, 8 fingers), many suspect that is why humans work with decimal numbers.
Data Representation Decimal Numbers Back in grade school we learn how to understand decimal numbers. For example, take the decimal number 3572 . In grade school, we probably learned to break-down this number as follows: 3 thousands 5 hundreds 7 tens 2 ones

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

View Full Document
Data Representation Decimal Numbers Another way to look at this number is multiplying the digit by 10 (the numbering base) raised to increasing powers (starting at 0 from the “ones” and moving towards the higher digits) 3 thousands = 3 x 10 3 = 3 x 1000 5 hundreds = 5 x 10 2 = 5 x 100 7 tens = 7 x 10 1 = 7 x 10 2 ones = 2 x 10 0 = 2 x 1 This way of understanding decimal numbers is the basis for math operations such as addition, subtraction, multiplication, decimal numbers, etc!
Data Representation Binary Numbers We can use a similar method to convert a binary number to a decimal number. We do the same thing in the previous slide, but we multiply by base 2 instead of base 10. Take the binary number 1101: 1 x 2 3 = 1 x 8 = 8 1 x 2 2 = 1 x 4 = 4 0 x 2 1 = 0 x 2 = 0 1 x 2 0 = 1 x 1 = 1 Remember, start from the right-hand-side and move to the left. + 13 Therefore, 1101 in binary is 13 in decimal . For programmers, the 8-bit binary number 00001101 can represent the unsigned integer 13 !

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

View Full Document
Data Representation Octal Numbers The octal numbering system (base 8) uses 8 symbols for each digit (0, 1, 2, … 7). We can use the same process in the previous slide to convert an octal number to a decimal number (but use base 8 instead!) . Convert the octal number
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 07/10/2011 for the course CTY 101 taught by Professor Don during the Spring '11 term at Seneca.

### Page1 / 39

Week04 - ULI101 Week 04 Week Overview Data Representation...

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

View Full Document
Ask a homework question - tutors are online