TAILIEUCHUNG - Algorithms and Data Structures in C part 1

Chapter 1 Data Representations This chapter introduces the various formats used by computers for the representation of integers, floating point numbers, and characters. | Algorithms and Data Structures in C by Alan Parker CRC Press CRC Press LLC ISBN 0849371716 Pub Date 08 01 93 Previous Table of Contents Next Chapter 1 Data Representations This chapter introduces the various formats used by computers for the representation of integers floating point numbers and characters. Extensive examples of these representations within the C programming language are provided. Integer Representations The tremendous growth in computers is partly due to the fact that physical devices can be built inexpensively which distinguish and manipulate two states at very high speeds. Since computers are devices which primarily act on two states 0 and 1 binary octal and hex representations are commonly used for the representation of computer data. The representation for each of these bases is shown in Table . Table Number Systems Binary Octal Hexadecimal Decimal 0 0 0 0 1 1 1 1 10 2 2 2 11 3 3 3 100 4 4 4 101 5 5 5 110 6 6 6 111 7 7 7 1000 10 8 8 1001 11 9 9 1010 12 A 10 1011 13 B 11 1100 14 C 12 1101 15 D 13 1110 16 E 14 1111 17 F 15 10000 20 10 16 Operations in each of these bases is analogous to base 10. In base 10 for example the decimal number is calculated as In a more precise form if a number X has n digits in front of the decimal and m digits past the decimal Its base 10 value would be For hexadecimal For octal In general for base r When using a theoretical representation to model an entity one can introduce a tremendous amount of bias into the thought process associated with the implementation of the entity. As an example consider Eq. which gives the value of a number in base r. In looking at Eq. if a system to perform the calculation of the value is built the natural approach is to subdivide the task into two subtasks a subtask to calculate the integer portion and a subtask to calculate the fractional portion however this bias is introduced by the theoretical model. Consider for instance an equally valid model for the .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.