hardware & i/o
DESCRIPTION
Hardware & I/O. Ch.4 – beginning on page 90 Ch.13 – Topic 1 & Topic 2. Representing Data. Representing Numbers. Extended ASCII256 characters EBCDIC256 characters UNICODE64K characters. Representing Characters. ASCII. EBCDIC. UNICODE. Quantifying Bytes. - PowerPoint PPT PresentationTRANSCRIPT
Hardware & I/O
Ch.4 – beginning on page 90
Ch.13 – Topic 1 & Topic 2
Representing Data
Positive Negative
Yes No
True False
On Off
1 0
RepresentingNumbers
Decimal Binary
(Base 10) (Base 2)
0 0
1 1
2 10
3 11
4 100
5 101
6 110
7 111
8 1000
9 1001
10 1010
11 1011
1000 1111101000
Representing Characters
• Extended ASCII 256 characters• EBCDIC 256 characters• UNICODE 64K characters
HI!
48 49 21
C8 C9 5A
? 16 bits each
ASCII
EBCDIC
UNICODE
Quantifying Bytes
1 Byte 8 bits
Kilobyte 210 bytes
Megabyte 220 bytes
Gigabyte 230 bytes
Terabyte 240 bytes
Petabyte 250 bytes
Exabyte 260 bytes
We deal with bytes all the time in programming. It seems that we are always counting bytes…. especially in Assembler language.Fortunately, we usually don’t need to deal in large numbers of bytes in our programs – a couple of hundred at a time, at most. Most of the time, many fewer than that – enough to fill an input or output buffer and we must accurately count the number of bytes within each field. Counting bytes seems to never end.
An older Mainframe Computer
IBM Stretch Computer - 7030
Circa 1964-1965
You can see a portion of the operator’s console on the very left side of this photo. The panels that open contain circuitry of the processor and memory.
Here is a look inside one of those panels that opens. How would you like to be the person who must do repairs on this computer?This is, of course, in the days before integrated circuitry. It was all hand-wired and (by today’s standard) very slow, although this was the faster computer in existence in its day. This is the computer that the first man-on-the-moon satellite was programmed.
Today’s Mainframe – Z/10
1 – 64 4.4GHz processors
1.52 Terabytes memory
6 ft. tall with a 30 Sq. Ft. footprint
2.5 tons
Computer power of 1500 industry-standard servers using 85% less power and covering 85% less floor space. Not much to look at, is it?
Announced Feb. 2008
A mainframe processor consists of …
• A Control Unit– Fetches instructions
• An Arithmetic and Logic Unit– Performs arithmetic– Compares
• General Purpose Registers• Just like a PC
And How Fast ???
Small z/9 system
Large z/9 system
Parallel systems up to 32
Pentium4E
(2004)
26MIPS
17,801MIPS
221,248MIPS
3.2GHz
Max11,000MIPS
MIPS stands for Millions of Instructions Per Second – and represents the measurement for mainframe speed (similar to PC GHz). It is a measurement that is no more accurate that GHz and has earned the new acronym meaning of Meaningless Indicator of Processor Speed.
Memory
• Capacity– PC --- 4 GB ?– Mainframe --- 1.52 TB ?
• Simultaneous Users– PC --- a few– Mainframe --- hundreds of thousands
Storage Devices
• Disk• Tape• CD• DVD• Flash Drive• paper
2 GB Flash Drive
9 MB Write / 15 MB Read
Retractable USB Connect
About $110
Magnetic Disk (PC)
TrackSector
Track
Magnetic Disk (PC)
Filename0
Filename1
Filename2
Filename3
Filename4
-
-
-
FATDirectory
Disk (Mainframe)
Catalog
pp. 22 & 23
VolumeFilename1 Vol label
Filename2 Vol label
Filename3 Vol label
Filename4 Vol label
filename5 Vol label
-
-
-
Catalog
Filename1
Filename2
VTOCVTOC = Volume Table of Contents
All files are typically cataloged and are usually found by using the catalog. Catalog entry points to the volume and VTOC that contains the file. Other routines verify that the file is really there.
Volume Table of Contents
Filename-1 DSCB
Filename-n DSCB
So how is the file found? Look in the catalog to find the volume, then look in the VTOC on the volume that contains the file. The DSCB is essentially a list of files (by name) located on the volume and its beginning cylinder and track number. Remember, the access arm on the device must be moved and that’s a mechanical (take-forever) process compared to memory speeds.
5.25”
19.0”
Another Mainframe deviceDS6800 from IBM
Capacity: up to 64 TBTransfer Rate: up to 1600 MB per sec.16 disk units (max: 128 units)
Accessing Data
• OPEN / CLOSE macros• OPEN prior to first access to data• CLOSE after last access to data,
usually in your eof routine
[label] OPEN dcb-label
[label] CLOSE dcb-label
Accessing Data
• Data Control Block (DCB)
• LRECL = length of record in bytes• RECFM = F for fixed-length• MACRF = G/P for Get/Put• DDNAME = path and filename• EODAD = input-only (label for EOF rtn.)
dcb-label DCB operand1,operand2,..
INDCB DCB LRECL=80,RECFM=F,MACRF=G,EODAD=EOFRTN,DDNAME=F:\TIMECDS.TXT
MVZ TOTAL+6(1),FCHAR replace the C with F for printing BR 5 return to main process ****************************************************************************** * END OF PROCESSING ****************************************************************************** DONE CLOSE LISTINGS close listings.txt file CLOSE REALTORS close realtors.txt file CLOSE CUSTOMER close customer.txt file CLOSE OUTPUT close output.txt file RETURN ****************************************************************************** *DECLARATIVES* ****************************************************************************** LISTINGS DCB LRECL=101,RECFM=F,MACRF=G,EODAD=LOOP02,DDNAME='h:\LISTINGS.TXT' REALTORS DCB LRECL=101,RECFM=F,MACRF=G,EODAD=HEADING,DDNAME='h:\REALTORS.TXT' CUSTOMER DCB LRECL=101,RECFM=F,MACRF=G,EODAD=DONE,DDNAME='h:\CUSTOMER.TXT' OUTPUT DCB LRECL=101,RECFM=F,MACRF=P,DDNAME='h:\OUTPUT.TXT' ******************************************************************************
Example (from REALTORS)
No need to test for EOF. Provide EODAD= rtn and the system will automatically take the branch when EOF occurs.
Accessing Data
• GET / PUT a Record• Input or Output 1 logical record
[label] GET dcb-label,area-name
[label] PUT dcb-label,area-name
OPEN INDCBOPEN OUTDCBGET INDCB,INBUFFPUT OUTDCB,OUTBUFFCLOSE INDCBCLOSE OUTDCB
START 0 *** *** OPEN LISTINGS open input file to be printed OPEN OUTPUT open or create output.txt file LOOP GET LISTINGS,LINE get line from input.txt file PUT OUTPUT,LINE put line to output.txt file B LOOP repeat ****************************************************************************** * END OF PROCESSING ****************************************************************************** DONE CLOSE LISTINGS close listings.txt file CLOSE OUTPUT close output.txt file RETURN ****************************************************************************** *DECLARATIVES* ****************************************************************************** LISTINGS DCB LRECL=101,RECFM=F,MACRF=G,EODAD=DONE,DDNAME='h:\LISTINGS.TXT' OUTPUT DCB LRECL=101,RECFM=F,MACRF=P,DDNAME='h:\OUTPUT.TXT' ****************************************************************************** LINE DS CL101 101 character line *** END START END PROCESS TITLED 'START'
Snippet of Code
End of I/O Slide Show