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

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

View Full Document Right Arrow Icon
ULI101 Week 04
Background image of page 1

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

View Full DocumentRight Arrow Icon
Week Overview Data Representation Binary, octal, decimal and hexadecimal numbering systems Number conversions Unix file permissions
Background image of page 2
Data Representation Why Study Data Representation? Computers process and store information in binary format 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
Background image of page 3

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

View Full DocumentRight Arrow Icon
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.
Background image of page 4
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.
Background image of page 5

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

View Full DocumentRight Arrow Icon
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
Background image of page 6
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!
Background image of page 7

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

View Full DocumentRight Arrow Icon
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 !
Background image of page 8
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 2741 to decimal: 2 x 8 3 = 2 x 5 1 2 = 1 0 2 4 7 x 8 2 = 7 x 6 4 = 4 4 8 4 x 8 1 = 4 x 8 = 3 2 1 x 8 0 = 1 x 1 = 1 Remember, start from the right-hand-side and move to the left. + 1505
Background image of page 9

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

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

Page1 / 36

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

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

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