• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 3 fuera de 25 páginas
Otro

Intro to Programming and Logic Class Notes

Document preview thumbnail
Vista previa 3 fuera de 25 páginas

 ALU -- Arithmetic Logic Unit o Performs all arithmetic and comparisons  Control Unit o Controls all operations to be performed  Main memory o Holds the data and the programs  Process  Data is picked up from the input device by the control unit  The control unit then stores it in main memory  How do we know where it’s stored?  Addressed -- identify the spot in memory where the variable is stored  Names can be given to the addresses  Main memory is measured in BYTES  Each byte holds one alphabetic character OR one or more numbers.  When we talk about memory and disk space, we use  Kilobytes -- 1,000 bytes  Megabytes -- 1 Million bytes  Gigabytes -- 1 Billion bytes  Terabytes -- 1 Trillion bytes  Let’s assume we have a computer with only 16 bytes of memory  Each square below represents 1 byte  Each square is assigned an address 0 1 2 S 3 T 4 E 5 V 6 E 7 N 13 14 15  The computer would input the first letter and put in address 2, input the 2nd letter and put it in address 3, etc  When it is time to print the name, we would have to remember the address used and refer to that address again in order to print the name.  That seems simple enough when the computer only has 16 addresses (bytes), but what about a million?  Instead, names can be assigned to an address, EX. (“”) o These names are variable names, which means they are easily changed.  When new data is moved to a location, old data is replaced.  Similarly, when calculations are done, the contents of the memory location (not the address) is used in the calculation. Bits, Bytes, and Nibbles  Bit = smallest unit o Stands for BInary digiT o Only has 2 values : 0 or 1  Nibble = 4 bits  Byte = 2 nibbles or 8 bits  Each memory location has: o An address = where it is o Contents = what’s in the address DATA STORAGE Data Storage o For text characters such as names and part descriptions, it takes one byte to store one character. This type of data is often called string data o For text characters such as names and part descriptions, it takes one byte to store one character. This type of data is often called string data o Some number are actually stringdata such as an address (5983 Macon Cove). If a number is not used in a calculation, it will be stored as a string data  Special characters will also be string data  Software o Applications  Does “people” work  Examples: spreadsheets, word processors, airline, reservations, ATM’s  Created using HIGH-LEVEL languages, such as C. Visual Basic (VB), PERL o Systems  Does computer work  Example: operating systems (Windows, Linux/Unix, Mac OS)  Controls the input output devices  Creation of Software o To run on a computer, software must be in machine language o Refer to Creation of software in 1/24/17 powerpoint  So how do we get from high-level to machine level? o High level is easier for people o Machine level is the only way for the machine o Must be translated o There are two ways to translate:  Interpreters - one instruction at a time  Compilers - all converted, then run  Source  Object  Pseudo Code and Programming languages o Pseudocode - computer like statements the would not really run on a computer, but it outlines what the steps will need to be o Programming Languages - a language designed for humans to write computer code  Syntax - rules that the code must follow  Examples: C, COBOL, Visual Basic, PERL  NUMBERING SYSTEMS Numbering Systems  Variables, Constants o Variables = data that changes o Constants = don’t change within the same program  Numeric Data o Used to do arithmetic  Hourly wage  GPA  Credit Hours  Age  String Data o Data that is not used in a calculation  Name  Address  Parts description o Any data not used in a calculation  Assigning values to variables o One of the main strengths of the computer is doing calculations quickly  Possible calculations  Add  Subtract  Multiply  Divide  Exponents ^  Formula example  avg = ((test1 + test2) / 2 * .60) + (labavg * .40)  The Decimal System o “Decimal” is the latin word for 10  Computers think in binary (not decimal) o Computers are made up of electrical circuits o On and Off  Off = 0  On = 1 o It’s easy for a computer to think as…  0 = no electricity  1 = electricity o Binary comes from the latin word Two  Counting in Binary o When we count in decimal  1, 2, 3, 4, 5, 6, 7, 8, 9 o In Binary, we do the same thing, only with fewer digits  1 (one), 1 0 (two), 1 1 (three) o Since there are so few valid digits in binary, look at binary in groups of four(one nibble) or eight (one byte)  15 is the maximum value of a nibble  255 is the value of a byte BINARY LED TO HEXADECIMAL  The hexadecimal system is used to make the binary system easy to interpret  Hexadecimal comes from the latin word for “Sixteen”  There are 16 digits in the hexadecimal system  The valid digits in hexadecimal are o 0 o 1 o 2 o 3 o 4 o 5 o 6 o 7 o 8 o 9 o A  10 o B  11 o C  12 o D  13 o E  14 o F  15  Any NIBBLE can hold 1 hexadecimal  Important concepts o Binary numbers are used to represent the circuits in a computer, with each binary digit representing one bit o Hexadecimal numbers are used to interpret the binary …. 4 bits at a time (one nibble) o To convert to and from binary, use powers of two o To convert to and from hexadecimal, use powers of sixteen o HEX is a common abbreviation for hexadecimal  You can convert binary to hexadecimal by converting one nibble at a time, and then combining the multiple nibbles to make each column of the hexadecimal ASCII & EBCDIC Text is ALSO represented in memory with hexadecimal values;  Each text character requires one byte in memory o however , instead of being calculated, letters and special characters are assigned a hexadecimal value  Numbers as string data o Remember that numbers are NOT used in calculations are string data  STEPS TO SOLVE A PROBLEM o Analyze the problem  Identify the problem  Understand the problem o Design a program to solve the problem  Identify alternative ways to solve the problem  Select the best alternative  List the instructions, step-by-step and in order, that solve the problem o Code the program  Translate the instructions into a computer language code  Translate the computer language to machine l


Información del documento

Subido en
4 de enero de 2023
Número de páginas
25
Escrito en
2022/2023
Tipo
Otro
Personaje
Desconocido
$8.49

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Vendido
1
Seguidores
1
Artículos
331
Última venta
3 año hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes

Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.