Advertisement
Ramaraunt1

Programming Lesson One Notes

Jan 11th, 2017
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.88 KB | None | 0 0
  1. ============================
  2. Hardware
  3. ============================
  4.  
  5. hardware - all physical devices of a computer.
  6. component - one of these devices
  7.  
  8. - The Central Processing Unit (CPU)
  9. CPU
  10. - Main Memory (RAM = Random Access Memory)
  11. Short term memory
  12. - Secondary Storage (Hard Disk/Solid State Drive)
  13. Long term memory
  14. - Input Devices:
  15. mouse, keyboard, microphone, touchpad, touchscreen
  16. - Output Devices:
  17. monitor, printer, fax machine, game controller vibrates
  18.  
  19. ============================
  20. Software
  21. ============================
  22.  
  23. Software is the nonphysical parts of a computer. Another word for software is computer programs.
  24.  
  25. System Software
  26. ---------------
  27. -Operating Systems:
  28. The most fundemental program that runs all other hardware and software.
  29. -Utility Programs:
  30. Specialized task programs. (antivirus programs, cleaner programs, compression programs, data backup programs)
  31. -Software Development Tools:
  32. Programs to make and modify other programs. IDE - Integrated Development Enviornment
  33.  
  34. Application Software
  35. --------------------
  36. Programs that make computers useful to humans.
  37. (microsoft word, excel, OBS, google chrome, team fortress 2)
  38.  
  39. =================================================
  40. Data Storage - How a computer stores information
  41. =================================================
  42.  
  43. 1s and 0s
  44. on and off switches
  45. ups or downs
  46.  
  47. 1 switch = 1 bit
  48. 8 bits = 1 byte
  49. nanosized mb, kb, gb, tb
  50.  
  51. 1 byte is enough information to store one number or character(symbol)
  52.  
  53.  
  54. 00000001 = 1
  55. 00000010 = 2
  56. 00000011 = 3
  57.  
  58. How numbers are stored:
  59. 1st bit = 2^7 = 128
  60. 2nd bit = 2^6 = 64
  61. 3rd bit = 2^5 = 32
  62. 4th bit = 2^4 = 16
  63. 5th bit = 2^3 = 8
  64. 6th bit = 2^2 = 4
  65. 7th bit = 2^1 = 2
  66. 8th bit = 2^0 = 1
  67.  
  68. 00000101 = 5
  69. 00100001 = 33
  70.  
  71. How letters/symbols are stored:
  72. ASCII - American Standard Code for Information Interchange
  73. 00100001 = 33 = !
  74. 01000100 = 34 = "
  75.  
  76. ASCII has only 128 characters. There are extended sets like Unicode with several thousand.
  77.  
  78. Special number cases
  79. What if I want a number that is bigger than 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 (255)
  80. Then, you add another byte
  81.  
  82. The order of the bytes varies.
  83. There is little endian (the smallest values come first),
  84. and big endian (the largest come first).
  85.  
  86. For little endian:
  87.  
  88.  
  89. first byte
  90. 1st bit = 2^7 = 128
  91. 2nd bit = 2^6 = 64
  92. 3rd bit = 2^5 = 32
  93. 4th bit = 2^4 = 16
  94. 5th bit = 2^3 = 8
  95. 6th bit = 2^2 = 4
  96. 7th bit = 2^1 = 2
  97. 8th bit = 2^0 = 1
  98.  
  99. second byte
  100. 9th bit = 2^17 = 131072
  101. 10th bit = 2^16 = 65536
  102. 11th bit = 2^15 = 32768
  103. 12th bit = 2^14 = 16384
  104. 13th bit = 2^13 = 8192
  105. 14th bit = 2^12 = 4096'
  106. 15th bit = 2^11 = 2048
  107. 16th bit = 2^10 = 1024
  108. 17th bit = 2^9 = 512
  109. 18th bit = 2^8 = 256
  110.  
  111. This gives 262,143 possibilities! Characters that use two bytes are called DBCS or the Double Byte Character Set
  112. But this isn't enough, even during the early days of computing
  113. So, people invented triple byte numbers, which go even higher. Then there are quadruple, and even pentuple byte numbers!
  114.  
  115.  
  116. Another special case:
  117. What if I want to store decimals?
  118. floating point notation - numbers that use this are called floats
  119.  
  120. What if I want to store negative numbers?
  121. Two's Compliment Notation - Usually done automatically
  122.  
  123. What if I want to store an image in memory?
  124. different formats:
  125. png, jpeg, dds, vtf, etc etc
  126. convert pixel information into bytes
  127. 1 unit of info = 1 pixel
  128.  
  129. What if I want to store sound data in memory?
  130. frequency and pitch are stored in binary.
  131. 1 unit of a sound file = 1 sample
  132.  
  133.  
  134. ==============================
  135. The Fetch Decode Execute Cycle
  136. ==============================
  137.  
  138. BEFORE fde, info about proccesses is moved to RAM, or main memory.
  139.  
  140. Fetch - The CPU fetches the information it needs from the ram.
  141. Decode - The CPU decodes what the information means.
  142. Execute - The CPU sends out commands to other components to execute the data.
  143.  
  144.  
  145. =====================
  146. Programming Languages
  147. =====================
  148.  
  149. - SINCE Machine Language is impossible to read by human standards, programming languages were developed.
  150.  
  151. - The first programming languages were known as Assembly Languages. Assembly languages are made up of
  152. nmenoics, small words short for commonly used commands
  153.  
  154. - Assembly languages are converted into Machine Language in a process known as Assembling.
  155.  
  156. - Eventually, Languages evolved and became Higher-Level Languages, which are used today and covered in these videos.
  157.  
  158. - These languages include:
  159. Python
  160. BASIC
  161. Visiual Basic
  162. C
  163. C#
  164. C++
  165. Java
  166. Ruby
  167. JavaScript
  168.  
  169. - Higher leveled languages all have Key Words/Reserved Words
  170. -Key Words: words that are reserved for a certain function, and cannot be used for ANYTHING else.
  171.  
  172. - Higher leveled languages all have operators
  173. -Examples in Python
  174. + (addition)
  175. - (subtraction)
  176. / (division)
  177. * (multiplication)
  178. % (modulus/remainder of division)
  179.  
  180. ALSO INCLUDE:
  181. ++, --, -=, +=, *=, /=, %=, etc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement