{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Week04

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

This preview shows pages 1–10. 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
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

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

View Full Document
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.
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.

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

View Full Document
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
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!

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

View Full Document
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 !
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 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.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern