Energy Optimal Bit Encoding for Flash Memory
Hanyang University
Hyunok Oh
Contents
Motivational Example
Related Work
Cost compression algorithm to minimize energy consumption
Implementation
Experimental Results
Conclusion
Motivational Example
Memory type
Operation
Time(us)
Energy(uJ)
Intel MLC
NOR
28F256L18
Program 00
110.00
2.37
Program 01
644.23
14.77
Program 10
684.57
15.60
Program 11
24.93
0.038
Energy consumption = 15.60 for 10101010…
= 0.038 for 11111111…
Y. Joo, etc. “Energy-Aware Data Compression for
Multi-Level Cell (MLC) Flash Memory”, DAC 2007
Energy/Time Minimization Problem
Minimize the total energy/time in the compressed data
Example
Let f(x) be the number of occurrence of symbol x in {00, 01, 10, 11}.
Assume that f(00,01,10,11) = (50, 25,25,0).
The energy consumption is (=2.37*50+14.77*25+15.60*25).
The energy consumption is 430.4 (= 2.37*25+14.77*25+0.038*25) if bit
patterns (00,01,10,11) change to (11,01,00,11).
Bit pattern mapping for optimal energy consumption
00
01
10
11
00
01
10
11
Cost Compression
• Each letter has a cost
• Minimize the total cost rather than the size
Morse Code
Cost compression problem
Minimize the sending time
Morse code example
Cost( - ) = 3
Cost( . ) = 1
-.--.- : cost = 4 * 3 + 2 * 1 = 14
.-..-. : cost = 2 * 3 + 4 * 1 = 10
Example
Assume f(a,b,c,d) = (5,3,4,5)
Total cost = 61 if codeword for (a,b,c,d) is (…, ..-, .-, -)
Total cost = 68 if codeword for (a,b,c,d) is (..,.-,-.,--)
How to find the mapping?
Related Work
•
•
•
•
Given cost (c1, …, cr) and probability (p1,…,pn)
Find a tree T* with n leaves with minimum cost over all trees with n leaves
(c1,c2,c3) = (1,1,2)
(p1,p2,p3,p4,p5) = (9/10, 1/40, 1/40, 1/40, 1/40)
– (a) is optimal
• (p1,p2,p3,p4,p5) = (1/5, 1/5, 1/5, 1/5, 1/5)
M. Golin, G. Rote, ”A Dynamic Programming
Algorithm for Constructing Optimal
Prefix-Free Codes for Unequal Letter Costs”,
IEEE Trans. Inform. Th.,
44(5), pp. 1770-1781, Sept. 1998.
Relate Work
Modified JPEG compression procedure with the proposed energy-aware
entropy coding for the MLC NOR flash
Cost Compression
• Constructing Optimal Prefix-Free Codes with
Unequal Letter Costs
– Unknown whether it is NP or not
– ILP (Integer Linear Programming)
– Dynamic Programming
– Heuristics
This presentation proposes
an optimal cost compression algorithm.
Proposed Approach
Optimal solution
Compression speed = size compression speed
Utilize the existing size compression algorithms
Proposed Approach for MLC flash
0100101
1010101
….
1101011
1011101
….
1010011
…
Size compression
Cost compression
1101011
1011101
….
1010011
…
Size compression
Example
• Assume that the size compressed data is
– Original data size is 10000 while the compressed one is 500.
• Assume that cost(0) = 1 and cost(1)=3
– Let f(0) and f(1) represent the frequencies of “0” and “1” in C
• Problem formulation
– Size constraint
• |C| <= |O|
– Minimize cost
• 1*f(0)+3*f(1)
– Entropy conservation since we cannot compress C smaller than S.
• H(C) >= 1/2
• -(p(0)log(p(0)) + p(1)log(p(1))) >= 0.5
• p(0)+p(1) = 1
– p(0) = 0.889, p(1) = 0.111
O
xyzw
xyzw
Size
compression
C
S
abcd
10…
Continue...
• If f(0) = 889 and f(1)=111 then the cost in C is
minimal
• How to ?
Size Decompression
• Arithmetic coding
– If there are 889 of 0’ and 111 of 1’ in data A then arithmetic coding
compresses data A to data B.
• The entropy of data B = 1
– If the arithmetic decoding decompresses data B with p(0)=0.889 and
p(1)=0.111 then data A is obtained.
– If the arithmetic decoding decompresses data S with p(0)=0.889 and
p(1)=0.111 then f(0)=889 and f(1)=111 in data C obtained.
• Assume that the entropy of data S = 1
A
10…
B
p(0)=0.889
p(1)=0.111
11..
A
10…
H(A)=1
S
abcd
p(0)=0.889
p(1)=0.111
C
10…
Cost Compression for Minimal Data
• Equivalent to size decompression
– Arithmetic decoding with given p(0) and p(1)
generates data in which the probabilities of 0 and
1 are p(0) and p(1) from source data(H=1)
regardless of the source data.
Proposed Cost Compression
O
0100101
1010101
….
Size
compression
S
Cost compression =
Size decompression
1010011
…
Adaptive
Arithmetic
Encoding
Any compression
Algorithm is applicable
C
S
1101011
1011101
….
Non-adaptive
Arithmetic
Decoding
Arithmetic coding and
Huffman coding are applicable.
Dictionary coding?
Cost Minimization for Flash Memory
Proposed framework
Write operation is performed by page unit in flash memory
Skip the cost compression if no size reduction is achieved by the size compression
Compression(or entropy) information must be saved in some place
No size reduction
Page unit
Size compression
Write with header
information
Compressed
data
Assign cost
optimal
probability
Cost compression
Page unit
Implementation – Size compression
Adaptive arithmetic coding
Any size compression algorithm is applicable
Compress data almost reach the best compression ratio
Compression process is done in a fully sequential manner, symbol
after symbol
Assignment of Cost Optimal Bit-Pattern
Probability
There are 4 bit patterns : 00, 01, 10, 11
Incremental and Common-Mode Costs are considered for each bit-pattern
The number of used bit patterns increases as entropy value increases
Linearize the probability into 7 sections in order to construct a table for the
entropy and the probability.
Probability Graphs
(a) Cost Optimal bit-pattern Frequency
(b) Heuristic Linear-Transformed bit-pattern Frequency
100%
100%
p1(00)
p1(00)
p2(01)
p2(01)
80%
80%
p3(10)
60%
60%
40%
40%
20%
20%
0%
0%
Energy gap Between Cost Optimal&Heuristic Linear-Transformed
nJul
60,000
50,000
40,000
30,000
20,000
10,000
0
Cost Minimal
p3(10)
p4(11)
p4(11)
Heuristic Linear Transformed
Cost Compression
Size decompression
Non-adaptive arithmetic coding is adopted
Decompress data with assigned optimal bit-pattern
probabilities
Uses 4 bit patterns for 4-level MLC Flash Memory
First 2-Byte is assigned for header which has entropy
information
Implementation – File Structure
2 bit header + 2 byte header
2bit header indicates how many bit-patterns are used.
2byte header indicates the size of the size compressed data for the entropy value
2-bit header
indicates
00
11 and 00 are used
01
11, 00, 01 are used
10
All patterns are used
11
No compression
(a) is used for no compression mode
(a)
Bit-pattern information header
data
(b) is used when 2-bit header is not 11
(b)
Number of compressed data
Experiment – Energy
Page size 1Kbyte
Text 362Kbyte
Page size 2Kbyte
Dll 329Kbyte
EXE 673Kbyte
(a) Energy Effiency
Page size 4Kbyte
PDF 902Kbyte
Page size 8Kbyte
JPG 879Kbyte
AVI 25.7Mbyte
Experiment –Latency
Page size 1Kbyte
Text 362Kbyte
Page size 2Kbyte
Dll 329Kbyte
EXE 673Kbyte
(b) Latency Efficiency
Page size 4Kbyte
PDF 902Kbyte
Page size 8Kbyte
JPG 879Kbyte
AVI 25.7Mbyte
Experiment –Endurance
Improvement in Endurance
Page size 1Kbyte
Text 362Kbyte
Page size 2Kbyte
Dll 329Kbyte
EXE 673Kbyte
Page size 4Kbyte
PDF 902Kbyte
Page size 8Kbyte
JPG 879Kbyte
AVI 25.7Mbyte
Conclusion
Propose a fast and optimal cost compression algorithm
Using size compression algorithms
Energy, latency and endurance are improved by applying the cost compression algorithm
un-compressed file type : energy and latency reductions are 25% ~ 75%
compressed file type : energy and latency reductions are 1~10%
Limitation and future work
Overhead of compression algorithm is not considered for latency and energy
consumption
We are currently developing a Huffman coding based algorithm.
© Copyright 2026 Paperzz