Skip to content

Instantly share code, notes, and snippets.

View cheungbo-mong's full-sized avatar
🎯
Focusing

Cheungbo Mong cheungbo-mong

🎯
Focusing
  • Kansas, USA
View GitHub Profile
@cheungbo-mong
cheungbo-mong / AnyCodable.swift
Last active February 8, 2021 09:10
Re-implement AnyCodable
import Foundation
struct AnyCodable: Codable {
let value: Any
init<T>(_ value: T?) {
self.value = value ?? ()
}
}
@cheungbo-mong
cheungbo-mong / 基础知识
Last active May 1, 2018 02:19
汇编语言
对于CPU来讲,系统中所有的存储器中的存储单元都存储在一个统一的逻辑存储器中,而它的容量受CPU寻址能力的限制。这个逻辑存储器就是内存地址空间。
1. 地址总线与内存地址空间的转换
2. 一根总线只能传递01两个信号,即传送1 bit内容,10根则可以传送2^10个信号,即1024bit内容
3. 1G=1024MB 1MB=1024KB 1KB=1024B
4. 20根总线可以传送(10+10=1024*1024B=)1MB内容
5. 地址总线宽度为32的CPU,可以传送10+10+10+2=4GB内容