100 likes | 218 Vues
This resource provides an overview of fundamental concepts in computer science regarding data representation. It covers binary values, including bits (0s and 1s), byte representation (8 bits), and methods for binary addition and modular arithmetic. The concept of two's complement is explained for negative values, along with the significance of mantissa and exponent in scientific notation. Additionally, it addresses how various numbers can be represented in binary and the importance of these concepts in understanding computing technology.
E N D
CSCI 1001 overview of computer science REPRESENTING DATA II
bit: a value that is either 0 or 1 string: a sequence of bits byte: a string of 8 bits
Binary A bit string can represent a number: 10110 = 1×24+0×23+1×22+1×21+0×20 A byte has the place values: What is the smallest possible byte? the largest?
1 1 1 1011 0111 + 1 0 0 1 0 Binary Adding Rules 1 0 1 0 1 1 0 0 1 1 1 + + + + + 0 1 1 1 0 1 1
1000 = 000 111 001 110 010 101 011 100 Modular Arithmetic
1000 = 000 -1 = 8-1 001 -2 = 8-2 010 -3 = 8-3 011 -4 = 8-4 Two’s Complement
8-bit two’s complement: -x = 28-x 100000000 256-x = (255 –x) + 1 01101001 - 11111111 To compute -x: “flip” the bits & add 1! 01101001 - 100101 1 0 + 1 10010111 x-y = x + (256-y) = x-y + 256
What do the following mean? 3.142 mantissa exponent 6.022 × 1023 1.616 × 10-35 base Mantissa Exponent Largest # 2 1 9.9×109 4 2 9.999×1099
in binary: 0.1101₂ = 1×2-1+1×2-2+0×2-3+1×2-4 0.1101×211₂ = 1×22+1×21+0×20+1×2-1 Mantissa Exponent Largest # 4 4 0.1111×215 9 5 0.111111111×231 52 10 ≈21023 ≈ 10307
http://cs1001.us/ Please read this article for Friday’s lecture: http://en.wikipedia.org/w/index.php?title=Markup_language&oldid=406618521