In: Computer Science
Question 1. which of the of the following statement(s) is(are) correct?
(a) Volatile memory loses all data when power is removed, but is easy to write to.
(b) DRAM needs to be accessed every few microseconds to refresh the charges, otherwise the information is lost.
(c) The storage of program usually requires nonvolatile memory.
(d) Each memory cell cost more in SRAM than DRAM.
(e) EPROM is electrically programmable but EEPROM is not electrically programmable.
Question 2. The mbed use a specific hardware communication interface other than any of the communication protocols such as SPI, I2C, UART, etc.
(a) True
(b) False
Question 3. We have the following C++ code in a function main():
string str_a = "ABCDE" ;
string str_b = "XYZUV" ;
string str_c = "TAMU" ;
string * ptr1 = NULL;
string * ptr2 = &str_b ;
ptr1 = &str_a ;
ptr1 = &str_c ;
cout << *ptr1 << endl;
cout << ptr1 << endl;
cout << *ptr2 << endl;
cout << ptr2 << endl;
What would be displayed when the above code segment is executed?
(a)
NULL
{the address of str_a}
XYZUV
{the address of str_b}
(b)
{the address of str_a}
ABCDE
{the address of str_b}
(c)
ABCDE
{the address of str_a}
XYZUV
{the address of str_b}
(d)
TAMU
{the address of str_c}
XYZUV
{the address of str_b}
(e)
ABCDE
XYZUV
{the address of str_a}
{the address of str_b}
(f)
TAMU
{the address of str_c}
ABCDE
{the address of str_a}
(g) None of (a) through (f) is a correct answer.
Question 4. the fseek() function can move the file point when reading data from a file. Assume that the original example.txt reads the following:
This is an apple.
After the execution of the following line, what would the file example.txt contain?
FILE * pFile;
pFile = fopen ( "example.txt" , "wb" );
fseek ( pFile , 10 , SEEK_SET );
fputs ( " sam" , pFile );
(a) This is an apple.
(b) This is a sample.
(c) This is an samle.
(d) This is an sample.
(e) None of (a) through (d) is the correct answer.
Question 5. what are the fundamental differences between SRAM and DRAM type memory?
Question 6. give the C/C++ code that defines an empty 5 element array called dataarray and a pointer called datapointer which is assigned to the first memory address of the data array.
Ans 1) Correct statements
a) Volatile memory loses all data when power is removed, but is easy to write to.
Volatile memory is computer storage that only maintains its data while the device is powered.Most RAM (random access memory) used for primary storage in personal computers is volatile memory. RAM is much faster to read from and write to than the other kinds of storage in a computer, such as the hard disk or removable media. However, the data in RAM stays there only while the computer is running; when the computer is shut off, RAM loses its data.
b) DRAM needs to be accessed every few microseconds to refresh the charges, otherwise the information is lost.
dram consist of only one transistor and then it is a
volatile memory.it is refreshed periodically otherswise
stored informations are deleted.
(c) The storage of program usually requires nonvolatile memory.
Non-volatile memory is typically used for the task of secondary storage, or long-term persistent storage.
d) Each memory cell cost more in SRAM than DRAM.
SRAM (Static RAM)
Data is stored in cross-coupled inverters
Large cell - requires several transistors (6T cell standard)
Fast access time / Low density
Integrates easily into logic fab processes
Ans 2)true
usb port enables communication
Ans 3) g)
none is the correct answer.
its going to show an error since both sr_a str_c are equal to *ptr1
Ans4) This ia an sample.
Ans 5) SRAM
>Short for static random access memory, and pronounced
ess-
ram.
>SRAM is a type of memory that is faster and more reliable
than the more common DRAM
>SRAM's store bits (1's or 0's) in memory cells that are
basically flip flops.To store 1 bit of information about 6
transistors are used
>it does not required refreshing
>it is more costlier than DRAM in terms of cost per bit,
DRAM
>DRAM stands for dynamic random access memory, a type of
memory used in most personal computers
>In DRAM to store 1 bit of information 1 transistor and 1
capacitor is used.
>The information is stored in the capacitor in form of
charge, so it required refreshing to retain the charge or
data in the capacitor.