ITP 165x Lecture Notes - Lecture 7: Binary Number

26 views1 pages

Document Summary

Itp 165: intro to c++ - lecture 7: binary and hexidecimal. This means that every digit can only be a 1 or a 0. Determine the largest power of 2 that fits inside the decimal number. Subtract that power of 2 from the decimal number, and put a 1 in the place corresponding to that power of 2. Repeat steps 1 and 2 until the decimal number is 0. Any places in the binary number that don"t have 1s in them should have 0s. Bit - a single digit in binary. An int is represented by 32 bits or 4 bytes. A char is a whole number type that"s represented by a single byte. Overflow - when there"s an extra digit in binary than alloted for a certain type and the extra digits and wiped out.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents