7. Assume two streams of bytes, N bytes separated
(N L 4095) and a 256 byte table.
Translate and Test Table
o 2 3 4 5 6 7 8 9 10 11 12 13 14 15
In stream 1 locate the first nonzero bit of each byte. On finding the first nonzero bit in stream 1, set the
corresponding bit position in stream 2 to zero. Con­ tinue this process to the end of the stream. A 256-
byte translate-and-test table is constructed in storage
such that:
Byte from 00000000 Byte from lxxxxxxx
Byte from 01xxxxxx
Byte from 001xxxxx Byte from 0001xxxx Byte from 00001xxx Byte from 000001xx Byte from 0000001x Byte from 00000001 fetches
fetches
fetches
fetches
fetches
fetches
fetches
fetches
fetches 00000000 from the table. (OJO) 01111111 from the table. (127 10 ) 10111111 from the table. (19110) 11011111 from the table. (22310) 11101111 from the table. (23910)
11110111 from the table. (24710) 11111011 from the table. (25110)
11111101 from the table. (25310)
11111110 from the table. (254 10 ) o
16
32
48
64 80 96
112
128
144 160 176
192 208 224 240 o 254 253
239 239 239
223 223 223
223 223 223
191 191 191
191 191 191
191 191 191
191 191 191
127 127 127
127 127 127
127 127 127
127 127 127
127 127 127
127 127 127
127 127 127
127 127 127 .. _.- 253 251 2 51 251 251 247
239 2392 39239239 239
223 2232 23223223 223
- - 223 2232 23223223 223
191 191 1 91 191 191 191 -- 191 191 1 91 191 191 191 I- 191 191 1 91 191 191 191 191 191 1 91 191 191 191 1----- 127 1271 27 127 127 127
127 1271 27 127 127 127
127 1271 27127127 127 I--- 127 1271 27127127 127
127 1271 27 127 127 127
127 1271 27 127 127 127
127 1271 27 127 127 127 -- 127 1271 27 127 127 127 --r-- 247 247 247 247 247 247 247 --- - ."- ---- 239 239 239 239 239 239 239
--- -- --- 223 223 223 223 223 223 223 ----- I--- --(---- 223 223 223 223 223 223 223
191 191 191 191 191 191 191 1---- f------- - -- --- f.--- 1-- 191 191 191 191 191 191 191 -- 1---- f.---- -- 191 191 191 191 191 191 191
--- --- -- I-- 1---- 1--- -- 191 191 191 191 191 191 191 f.-- f--- -" -- 127 127 127 127 127 127 127 -- ---- --- I---- I-- --- - -
127 127 127 127 127 127 127 --1------ --- -- f---- 1--- --- 127 127 127 127 127 127 127 1----- 1---- 1---- ---
127 127 127 127 127 127 127
- --- I---- --- 1----- 1-- - t--
127 127 127 127 127 127 127 -- I-- 1----1--- ---
127 127 127 127 127 127 127 --- [----J- - - 127 127 127 127 127 127 127
-- - -- --- - ----- -- --- t- 127 127 127 127 127 127 127 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
All Decimal Numbers Represent an 8-Bit Binary Value
IBM
IBM SYBtem/360 Aesumbler Coding Form PROGRAM TEST AND Cf/AN(j£ BIT STREAMS PUNCHiNG iNSTRUCTiONS PAGE OF I I ti t-FF --- .- GRAPHiC CARD ELECTRO NUMBER PROGRAMMER I DATE PUNCH T T STATEMENT Identification- Name Operation Operand Comments Sequence _+-"',18 _T_-.--T
2
=,5,--,-,--r-r=3.:;-0
--.--,,-,=35.-,-,-,-,4.:;-0 -c::-r-.-T----r=45'-r---,--.-- , __ 50 ___ _ _ ,Q.Q _ _ _ _ f-----l-'-7",3 -,--,,---,--_,-_, -i?O I?- T:_ 0 J'l Ii "t'19 , f- P Ii M 0 R L G I II POI W T i _ _ 1-1 B A L R I " , 0 _ I-- I-- __ I- 0 A P.c-: R E (j I S I- - I U S_ I II Cj *, / oS" D €f J II E 13 A S £ R. E <i 1 S- I B _ START START l'<iM DC F' 249' S;L8EAM I L ENg Ttf q 0 IV. S Iv C f=- -A ( S T R A M - I )_ 1 __ C 0 (II TAN TAD D R __ B L £1 1-__ 1_ D C X L 2 oS" 6 - - - foO - - - __ _ T RAN S ATE T A 'B L £. .§. T R. £ A;M i- _ D - 7 SO CST REA M- S TO 1( A q £. ARE A I - -- -- I .s: LA 7) -I-lc--}---I--l,L""-\ -'_ L I AR i&-0t-t---! LR I __ •. S(R EX BC
EX R f---f-I---+-Ih-I L 1- TRANSII-- AND r TR T
NI +1- +--t-- -- -1--- I -:- ----f---I--- - -1-- i- O,COi-1STI ( 1 C Q IV. 2 0) I t/,O t/,I j- 'I, TR.,4 N i 8 ,ouT Z)AND o , I I--- OU T LOOP -1-- I(,I),TABL£ SOO(I),O f-- f- -- - LGTH TO RO I-- S T M S TAR TAD D R - ITO -i-- E 1'112+- 0 F S T R £ A M -/ TOR 0 ENDI-0F STREAM -/IITO R'I LiN i H 0 F S T R
£ AM TO, R'II £ X E C (j T E T R TIN S T/ / I /
£ NiD ..• 0 F 5 T R
£ A M BRA N C H . . £ X £ C (j T E A["lv I' I EN',Z)r-_.--.OF. STREAM. -I VS IT£_·.sT OuT LAST STREAM ITEM CONTiNUE I rEiT HT STRW Z POSlf
ON
I i- i I-- -1-- -- +- j- R I f f- ... 1- - - f-I---j- ._- f- -t--
P OS -- I- .. Appendix A 131
Appendix B. Fixed-Point and Two's Complement Notation
A fixed-point number is a signed value, recorded as a
binary integer. It is called fixed point because the pro­
grammer determines the fixed positioning of the binary
point.
Fixed-point operands may be recorded in halfword
(16 bits) or word (32 bits) lengths. In both lengths,
the first bit position (0) holds the sign of the number,
with the remaining bit positions (1-15 for halfwords
and 1-31 for fullwords) used to designate the mag­
nitude of the number. Positive fixed-point numbers are represented in true
binary form with a zero sign bit. Negative fixed-paint
numbers are represented in two's complement notation
with a one bit in the sign position. In all cases, the
bits between the sign bit and the leftmost significant
bit of the integer are the same as the sign bit (i.e.
all zeros for positive numbers, a1l ones for negative
numbers).
Negative fixed-point numbers arc formed in two's
complement notation by inverting each bit of the posi­
tive binary number and adding one. For example, the
true binary form of the decimal value (plus 26) is
made negative (minus 26) in the following manner:
+26
Invert
Add 1
-26 S INTEGER
o 0000000 00011010 1 1111111 11100101 1
1111111111100110 (Two's complement form)
This is equivalent to subtracting the number: 0000000000011010 from 1 0000000000000000. 132
The following addition examples illustrate two's
complement arithmetic. Only eight bit positions are
used. All negative numbers are in two's complement
form. COMMENTS +57 00111001 +35 00100011 +92 01011100 +57 00111001 -35 11011101 No overflow
+22 00010110 Ignore carry -carry into high
order position and carry out.
+35 00100011 -57 11000111 -22 11101010 Sign change only; no carry.
-57 11000111 -35 11011101 No overflow
-92 10100100 Ignore carry -carry into high
order position and carry out.
-57 11000111 -92 10100100 -149 (/01101011 (/Overfiow - no carry into high
order position but carry out.
+57 00111001 +92 01011100 149 (/10010101 (/Overflow - carry into high order
position, no carry out.
The following are 16-bit fixed-point numbers. The first is the largest positive number and the last, the
largest negative number.
NUMBER DECIMAL S INTEGER 2
'0
-1 32,767 =0 1111111 11111111 1 = 0 0000000 00000001 0 0 = 0 0000000 00000000 _2° -1 =1111111111111111 __ 2]" -32,768 = 1 0000000 00000000 The following are 32 bit fixed-point numbers. The first is the largest positive number that can be repre­
sented by 32 bits, and the last is the largest negative
number.
NUMBER
2
31 -1 2·'fl o --2" -2' _218 __ 281 +1 =
_2
31
DECIMAL
2147483647
65536
1
o -1 -2 -65536 -2 147483647 -2 147483 648
INTEGER =0 111111111111111 11111111 11111111
= 0 0000000 00000001 00000000 00000000 = 0 0000000 00000000 00000000 00000001 = 0 0000000 00000000 00000000 00000000 = 1 111111111111111 11111111 11111111
=1 111111111111111 1111111111111110
= 1 1111111 11111111 00000000 00000000 = 1 0000000 00000000 00000000 00000001 = 1 0000000 00000000 00000000 00000000
Previous Page Next Page