Cheatography

# ComSci IBDP 1 Cheat Sheet by iutii

A cheatsheet for computer science, python and pseudocode

### Converting

 From Hexade­cimal to decimal From Binary to Hexade­cimal BF=B*161+ F*160=11*161+ 15*160=171+1­5=191 1) Find the biggest power of 16 that fits in - number of positions 3501- 16, 256, 4096 2) Find the biggest multiplier x*256, that fits? x=13=D 3501-1­3*2­56=173 Y16<173, 1016=A*16 173-16­0=13, 13=D 3501(2­)=D­AD(16) From Binary to decimal From Decimal to binary Just multip­lying 1 or 0 by 2 in the power of position 1) find the biggest power of 2 that fits - number of positions 10100=1*24+1*22=20 63=25 2) Find the biggest multiplier 63-32=31, 24 31-16=15, 23 15-8=7, 22 7-4=3, 2^1 3-2=1, 2^0 63(10)­=11­1111(2) Hexade­cimal to binary Decimal to hexade­cimal 1)Each number should represent the four digits in the binary number 191:16­=11.R => R*16=.9­37­5+16=15 BF => 8 digits if the number before is less than 16, then it is the first digit, if not, then keep counting B=11, 11=1011 11 => B F=15, 15=1111 BF, reading backwards BF(16)­=10­111­111(2)

### X() gates

 These are XAND and XOR gates, they are exclusive So for XAND only if both inputs are identical it will give a 1 For XOR only if they are both different, it will give a 1

### N() gates

 The gates with N, such as NOR, NAND, XNOR, NOR, XNAND, are just gates with a NOT after them